PaulStoffregen
Well-known member
How do you stop LTO from touching my inline assembly code?
What is it doing to your inline asm?
How do you stop LTO from touching my inline assembly code?
How do you stop LTO from touching my inline assembly code?
here you can see without downloading anything, just compile this sketch with and without LTO and look at disassembly of the sketch using objdump: (I used Fastest with LTO, Fastest menu options for this test)What is it doing to your inline asm?
void setup() {
}
void loop() {
delayMicroseconds(100000);
}
LTO still seems to muck with the inline assembly even when the memory barrier is added.does barrier work with enclosing asm volatile("" ::: "memory");
see https://forum.pjrc.com/threads/17469-millis()-on-teensy-3?p=22279&viewfull=1#post22279
LTO still seems to muck with the inline assembly even when the memory barrier is added.
I'm still debating what the default should be for each board. Obviously Teensy LC needs -Os. In most the tests I've tried, -O3 adds significantly to the program size, so I'm a bit reluctant to make it the default for Teensy 3.0, 3.1, 3.2 where so many programs already exist.
Is this bug or feature, I don't know but LTO seems to really turn your code upside down.It might be the LTO bug/feature has been fixed. However, unless somebody sends in a bug report to the proper channels, it may never be fixed (https://gcc.gnu.org/bugs/)
That could work, I'll see what I can do with that.@Duff: why not print a #warning that your code does not work with LTO
Before I go that far I would want to see if other peoples code is effected, I really don't know enough right now to say one way or the other. Frank did you look at the memcpy_audio.S disassembly? Does it work?Frank B said:Yes, @Duff should create a minimal example and report the bug ...
float add_flt (float a, float b)
{
return a+b;
}
Duff!! Indeed !Is this bug or feature, I don't know but LTO seems to really turn your code upside down.
Frank did you look at the memcpy_audio.S disassembly? Does it work?
[COLOR=#78492A][FONT=Menlo]#pragma GCC push_options[/FONT][/COLOR]
[COLOR=#78492A][FONT=Menlo]#pragma GCC optimize ([COLOR=#d12f1b]"no-lto"[/COLOR])
void funct() {
}
[/FONT][/COLOR]
[COLOR=#78492A][FONT=Menlo]#pragma GCC pop_options[/FONT][/COLOR]
Or if anyone really wants to keep playing with gcc 5.4 can still use 1.34-beta1, just not with the new Arduino 1.8.0 release.
Adafruit_CC3000 buildtest example
ks0108 error compiling
LowPower fails on all boards, even Teensy 2.0
PS2Keyboard errors
ST7565 error, C++ overload on srandom()
FlexCAN CANtest warning
OSC many warnings
RadioHead warnings
teensy_ssd1351 warnings
TinyGPS test_with_gps_device warning
VirtualWire warnings, unused stuff
X10 many warnings - ancient arduino stuff
Adafruit_SleepyDog warning on Teensy 3.x
AppleMidi warnings
Eigen313 warnings
MFRC522 warnings
EthernetBonjour many warnings
With Teensy 3.2, "fastest with LTO" i get
"upload@1679610-Teensy Firmware 'print_mac.ino.TEENSY31.hex' is not compatible with '1679610-Teensy'"
with TYQT
Might be a TYQT issue ??
Confirmed