------- Comment #5 from ro at CeBiTec dot Uni-Bielefeld dot DE  2009-11-04 
18:34 -------
Subject: Re:  [4.5 regression] cc1 SEGV compiling maxval_r16.c

> Unfortunately, the problem does not reproduce in such a cross compiler,
> so I'll have to either start a native reghunt or find a way to debug the
> native compiler (maybe compiling with -g without -O2 or try the stage1
> compiler if it is also affected).

I was misled by the fact that the hg mirror of trunk hasn't been updated
in almost two months, so I've been testing the wrong sources.  With svn
trunk, I can reproduce the problem:

run -std=gnu99 -O2 maxval_r16.i
Starting program: /vol/gcc/obj/gcc-reghunt/153800/gcc/cc1 -std=gnu99 -O2
maxval_r16.i
warning: Temporarily disabling breakpoints for unloaded shared library
"/usr/lib/ld.so.1"
Breakpoint 3 at 0xfeef4b00
Breakpoint 4 at 0xfef01652
 mmaxval_r16
Analyzing compilation unit
Performing interprocedural optimizations
 <visibility> <> <early_local_cleanups> <whole-program> <cp> <inline>
<static-var> <pure-const>Assembling functions:
 mmaxval_r16
Program received signal SIGSEGV, Segmentation fault.
simplify_replace_fn_rtx (x=0x0, old_rtx=0xfee55df0, fn=0, data=0xfee5fc08) at
/vol/gcc/src/gcc-dist/gcc/simplify-rtx.c:364
(gdb) where
#0  simplify_replace_fn_rtx (x=0x0, old_rtx=0xfee55df0, fn=0, data=0xfee5fc08)
at /vol/gcc/src/gcc-dist/gcc/simplify-rtx.c:364
#1  0x0836d367 in simplify_replace_fn_rtx (x=0xfee7f030, old_rtx=0xfee55df0,
fn=0, data=0xfee5fc08) at /vol/gcc/src/gcc-dist/gcc/simplify-rtx.c:492
#2  0x0836d367 in simplify_replace_fn_rtx (x=0xfee7f018, old_rtx=0xfee55df0,
fn=0, data=0xfee5fc08) at /vol/gcc/src/gcc-dist/gcc/simplify-rtx.c:492
#3  0x0836d367 in simplify_replace_fn_rtx (x=0xfee7f00c, old_rtx=0xfee55df0,
fn=0, data=0xfee5fc08) at /vol/gcc/src/gcc-dist/gcc/simplify-rtx.c:492
#4  0x0836d6e2 in simplify_replace_rtx (x=0xfee7f00c, old_rtx=0xfee55df0,
new_rtx=0xfee5fc08) at /vol/gcc/src/gcc-dist/gcc/simplify-rtx.c:510
#5  0x082507ef in try_replace_reg (from=0xfee55df0, to=0xfee5fc08,
insn=0xfee5369c) at /vol/gcc/src/gcc-dist/gcc/gcse.c:2278
#6  0x08250c46 in constprop_register (insn=0xfee5369c, from=0xfee55df0,
to=0xfee5fc08) at /vol/gcc/src/gcc-dist/gcc/gcse.c:2511
#7  0x08251e14 in execute_rtl_cprop () at /vol/gcc/src/gcc-dist/gcc/gcse.c:2701
#8  0x082ea4b0 in execute_one_pass (pass=0x87a3240) at
/vol/gcc/src/gcc-dist/gcc/passes.c:1518
#9  0x082ea577 in execute_pass_list (pass=0x87a3240) at
/vol/gcc/src/gcc-dist/gcc/passes.c:1567
#10 0x082ea58b in execute_pass_list (pass=0x87a38a0) at
/vol/gcc/src/gcc-dist/gcc/passes.c:1568
#11 0x083d6649 in tree_rest_of_compilation (fndecl=0xfee62000) at
/vol/gcc/src/gcc-dist/gcc/tree-optimize.c:392
#12 0x0852436c in cgraph_expand_function (node=0xfee64000) at
/vol/gcc/src/gcc-dist/gcc/cgraphunit.c:1160
#13 0x0852609d in cgraph_optimize () at
/vol/gcc/src/gcc-dist/gcc/cgraphunit.c:1219
#14 0x085263f2 in cgraph_finalize_compilation_unit () at
/vol/gcc/src/gcc-dist/gcc/cgraphunit.c:1089
#15 0x080beb4f in c_write_global_declarations () at
/vol/gcc/src/gcc-dist/gcc/c-decl.c:9489
#16 0x08381ed3 in toplev_main (argc=4, argv=0x80477bc) at
/vol/gcc/src/gcc-dist/gcc/toplev.c:1061
#17 0x08126fdf in main (argc=4, argv=0x80477bc) at
/vol/gcc/src/gcc-dist/gcc/main.c:35

simplify_replace_fn_rtx is called with x = NULL above, thus GET_MODE (x)
segfaults.  So it seems likely that the introduction of
simplify_replace_fn_rtx is the culprit.

        Rainer


-- 


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

Reply via email to