9 ms·
GCC optimization causes the frame pointer push to move around, resulting in wrong call stacks. "Wontfix" https://news.ycombinator.com/item?id=38896343 https:/
by DaveFlater 3y ago
GCC optimization causes the frame pointer push to move around, resulting in wrong call stacks. "Wontfix"
https://news.ycombinator.com/item?id=38896343 https://news.ycombinator.com/item?id=38896343
- rwmj 3y agoThat was in 2012. Does it still occur on modern GCC? There definitely have been regressions with frame pointers being enabled, although we've fixed all the ones we've found in current (2024) Fedora.
- jart 3y agoI think so and I vaguely seem to recall -fno-schedule-insns2 being the only thing that fixes it. To get the full power of frame pointers and hackable binary, what I use is: -fno-schedule-insns2 -fno-omit-frame-pointers -fno-optimize-sibling-calls -mno-omit-leaf-frame-pointer -fpatchable-function-entry=18,16 -fno-inline-functions-called-once The only flag that's potentially problematic is -fno-optimize-sibling-calls since it breaks the optimal approach to writing interpreters and slows down code that's written in a more mathematical style.
- ndesaulniers 3y agoPretty sure unwinding thumb generated by GCC is still non-unwindable via FPs. That's been a pain.