LTO seems to be breaking some things. It's probably bugs in libraries like missing volatile, but until all those get fixed LTO probably can't be in the default location, except for these early betas.
Yup; but i'd say LTO ist working good, the code is the problem..
My latest experience from today is: I re-activated my old project "C64 Emulation" wich is very much work in progress. In an intermediate step during development, i added a static array - but only wrote to it, never read. normally, gcc emits a warning in this case but produces working code-output.
This time not, and instead the code crashed, only because a "*sp++=0;".. i guess, the array got optimized out, but there were (still) the writes (?) - or something like that (code works without LTO). With LTO, code-development must be done much more carefull..
I doubt that this is good for Arduino. But it would be GREAT if there was a way, for advanced users, to activate it in Teensyduino.
On the other hand, are there really cases where LTO ist faster on the Teensy ? In my experience, it is slower..
The (small) gain of "-mpure-code" is more impressive, at the moment
(
Edit: Around 0.5%..1% faster.)