[Bug target/114116] [14 Regression] Broken backtraces in bootstrapped x86_64 gcc
lukas.graetz@tu-darmstadt.de
gcc-bugzilla@gcc.gnu.org
Thu Feb 29 14:31:20 GMT 2024
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114116
--- Comment #9 from Lukas Grätz <lukas.graetz@tu-darmstadt.de> ---
(In reply to H.J. Lu from comment #8)
> (In reply to Lukas Grätz from comment #7)
> > (In reply to H.J. Lu from comment #6)
> > > (In reply to Jakub Jelinek from comment #5)
> > > > Yeah. Not to mention, one can call backtrace even if -g0; you just don't
> > > > get nice names for the addresses. Without the patch you get crashes in the
> > > > unwinder when doing backtrace.
> > >
> > > Should we generate REG_CFA_UNDEFINED for unsaved callee-saved registers to
> > > help unwinder:
> > >
> > > https://patchwork.sourceware.org/project/gcc/list/?series=30327
> >
> > Yes. Also for gdb this is needed.
> >
> > Perhaps I did something wrong. On my computer, I could get the first patch
> > working to save rbp, I also applied the patch which should omit the
> > .cfi_undefined. But somehow, I still not get .cfi_undefined for any of the
> > examples.
> >
> >
> > $ ./gcc/host-x86_64-pc-linux-gnu/gcc/cc1 -O3
> > gcc/gcc/testsuite/gcc.target/i386/pr38534-7.c -o pr38534-7.S
> >
> > $ cat pr38534-7.S
> > [...]
> > no_return_to_caller:
> > .LFB0:
> > .cfi_startproc
> > pushq %rbp
> > .cfi_def_cfa_offset 16
> > .cfi_offset 6, -16
> > movl $array+67108860, %eax
> > xorl %r13d, %r13d
> > [...]
> >
> >
> > The ".cfi_undefined 13" is still missing...
>
> It is generated only when -g is used.
Not on my computer. When I used -g I got:
no_return_to_caller:
.LFB0:
.loc 1 16 1 view -0
.cfi_startproc
.loc 1 17 3 view .LVU1
.loc 1 18 3 view .LVU2
.LVL0:
.loc 1 18 26 discriminator 1 view .LVU3
.loc 1 16 1 is_stmt 0 view .LVU4
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movl $array+67108860, %eax
.loc 1 21 31 view .LVU5
xorl %r13d, %r13d
.loc 1 16 1 view .LVU6
Still no .cfi_undefined 13. In principle, it should also be generated without
-g, as the rest of .cfi_offset and friends.
More information about the Gcc-bugs
mailing list