egcs-970828 bug with -fprofile-arcs
Joseph S. Myers
jsm28@hermes.cam.ac.uk
Thu Sep 4 14:10:00 GMT 1997
With egcs-970904 plus the patch, there is still a problem if you use -O
(same test file). Here is a backtrace:
(gdb) run /tmp/bug.i -quiet -O -version -fprofile-arcs -o /tmp/bug.s
Starting program: /usr/src/BETA/egcs-970904/gcc/./cc1 /tmp/bug.i -quiet -O -version -fprofile-arcs -o /tmp/bug.s
Breakpoint 1 at 0x4005cd64
GNU C version egcs-2.90.05 970904 (gcc2-970802 experimental) (i586-pc-linux-gnulibc1) compiled by GNU C version egcs-2.90.05 970904 (gcc2-970802 experimental).
Program received signal SIGSEGV, Segmentation fault.
output_arc_profiler (arcno=2, insert_after=0x81af638) at profile.c:1545
1545 if (GET_CODE (next_insert_after) == INSN)
(gdb) bt
#0 output_arc_profiler (arcno=2, insert_after=0x81af638) at profile.c:1545
#1 0x8150c61 in instrument_arcs (f=0x81af41c, num_blocks=4, dump_file=0x0)
at profile.c:243
#2 0x81518f4 in branch_prob (f=0x81af41c, dump_file=0x0) at profile.c:912
#3 0x80660d6 in rest_of_compilation (decl=0x81ac8a8) at toplev.c:3293
#4 0x8152afe in output_func_start_profiler () at profile.c:1630
#5 0x8064f2d in compile_file (name=0xbffffbe0 "/tmp/bug.i") at toplev.c:2493
#6 0x80677d1 in main (argc=8, argv=0xbffffabc, envp=0xbffffae0)
at toplev.c:4321
#7 0x804902e in _start ()
(gdb) p next_insert_after
$1 = 0x0
(gdb) p insert_after
$2 = 0x81af638
(gdb) pr $2
(call_insn 10 8 12 (set (reg:SI 0 %eax)
(call (mem:QI (symbol_ref:SI ("__bb_init_func")))
(const_int 4))) -1 (nil)
(nil)
(nil))
(gdb) up
#1 0x8150c61 in instrument_arcs (f=0x81af41c, num_blocks=4, dump_file=0x0)
at profile.c:243
243 output_arc_profiler (total_num_arcs_instrumented
(gdb) p f
$3 = 0x81af41c
(gdb) pr $3
(note 2 0 17 "" NOTE_INSN_DELETED)
(gdb) up
#2 0x81518f4 in branch_prob (f=0x81af41c, dump_file=0x0) at profile.c:912
912 instrument_arcs (f, num_blocks, dump_file);
(gdb) p f
$4 = 0x81af41c
(gdb) pr $4
(note 2 0 17 "" NOTE_INSN_DELETED)
--
Joseph S. Myers
jsm28@cam.ac.uk
More information about the Gcc-bugs
mailing list