If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Then Arduino will show you the exact gcc commands it is using to compile your program. Most of these just change the -O optimization level. Some also add C library specs, for the reduced size printf. Arduino's console panel supports copy to clipboard, so you can copy compiler commands from different tests into a text editor to more easily see what each option changed.

If you *really* want to dig into the details, you'll probably need to read the gcc documentation which can be found online. It's a deep rabbit hold of compiler optimization details.

Turns on Link-time Optimizations.
GCC produces additional informations to optimize stuff across the various modules which compose the final executable.
Beware: LTO sometimes BREAKS the resulting executable, which may run oddlly or not at all.
For example, I got issues with a few OLED libraries.

Pure Code

This is is not available on Teensy LC (can't remember about T4.x, can't check at the moment).
It forces the compiler not to store read-only data in the "code" section (so it will put it in the "data" section instead).
It should strengthen security; not sure if it helps performances too.

Debug

For Teensy+Arduino environment, I don't think it's useful. We don't have an integrated step debugger (unfortunately).

Smallest code

The compiler strives to produce the smallest possible code, even at the cost of reducing speed optimizations (i.e. loops unrolling).
It helps when you have a Teensy model with smaller program memory (for example the LC) and/or a large program.