https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55667
Fangrui Song <maskray at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |maskray at gcc dot gnu.org
--- Comment #4 from Fangrui Song <maskray at gcc dot gnu.org> ---
Realize this is a very old thread, but I came across it via
https://news.ycombinator.com/item?id=34803759 (Frame pointers vs. DWARF) and
wanted to chime in.
There's been ongoing interest in compact unwind information, with relevant
discussions like:
https://discourse.llvm.org/t/rfc-improving-compact-x86-64-compact-unwind-descriptors/47471/23
https://sourceware.org/pipermail/binutils/2025-November/145523.html (Regarding
"More compact SFrames through deduplication")
Regularizing prologue and epilogue code seems key to making unwind format
smaller (better deduplication or amenable to be described by a small opcode)
Once GCC implements a compact unwind format, instruction rescheduling in the
prologue should ideally not be necessary, even without specifying
-fno-schedule-insns2.
---
Simplified "Created attachment 28939" in #c0
#include <stdio.h>
#include <stdint.h>
uint64_t accumulator=1;
double adder=0;
void fn2() __attribute__((noinline,optimize("no-optimize-sibling-calls")));
void fn2() {
for (uint64_t looper=0; looper<100000000; ++looper)
adder += 3.14159265358979323846*3, accumulator = accumulator*3 + adder;
}
int main() {
fn2();
printf ("%" "l" "u" " %f\n", accumulator, adder);
return 0;
}
gcc -O2 -fno-omit-frame-pointer output contains
"main":
push rbp
mov edi, OFFSET FLAT:.LC2
mov rbp, rsp