[Bug debug/12267] New: [3.4 regression] function-at-a-time generates stabs in bad order

mec at shout dot net gcc-bugzilla@gcc.gnu.org
Fri Sep 12 18:50:00 GMT 2003


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12267

           Summary: [3.4 regression] function-at-a-time generates stabs in
                    bad order
           Product: gcc
           Version: 3.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P1
         Component: debug
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: mec at shout dot net
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu

I am seeing a regression in debug info with this patch:

Fri Sep  5 07:35:16 CEST 2003  Jan Hubicka  <jh@suse.cz>

        * opts.c (decode_options): Enable unit-at-a-time at -O2.
        * params.def (max-inline-insns-single): Set to 500
        (max-inline-insns-auto): Set to 150
        * invoke.texi (max-inline-insns-single, max-inline-insns-auto): Update.

I have a sample program which I compile with "gcc -gstabs+ -O2 -S".
The sample program and the assembly output are attached.

The problem happens at the end of main:

.LM31:
        ret
        .size   main, .-main
        .stabs  "factorial:F(0,3)",36,0,93,factorial
.Lscope7:
        .stabs  "",36,0,0,.Lscope7-main
        .text
        .stabs "",100,0,0,.Letext
.Letext:
        .section        .note.GNU-stack,"",@progbits
        .ident  "GCC: (GNU) 3.4 20030905 (experimental)"

The bad line is the stab for "factorial:F(0,3)" which occurs in the terminal
portion of main, between ".size main, .-main" and "stabs
"",36,0,0,.Lscope7-main".  This messes up the gdb block table for "main",
causing a regression in the gdb test script gdb.base/break.exp.

In the source file, main comes first, but in the object file, factorial is
emitted first.  It looks like a scrap of "factorial" was left behind when it was
rearranged to be omitted before "main".



More information about the Gcc-bugs mailing list