* [Bug target/41930] [4.5 regression] cc1 SEGV compiling maxval_r16.c
2009-11-03 18:32 [Bug target/41930] New: [4.5 regression] cc1 SEGV compiling maxval_r16.c ro at gcc dot gnu dot org
@ 2009-11-04 17:52 ` ro at CeBiTec dot Uni-Bielefeld dot DE
2009-11-04 17:53 ` ro at gcc dot gnu dot org
` (11 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: ro at CeBiTec dot Uni-Bielefeld dot DE @ 2009-11-04 17:52 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from ro at CeBiTec dot Uni-Bielefeld dot DE 2009-11-04 17:52 -------
Subject: [4.5 regression] cc1 SEGV compiling maxval_r16.c
Unfortunately, gdb 7.0 crashes as well, so I cannot investigate the
problem this way. But I've been able to produce a minimized testcase,
which I'll attach.
I'll build a cross compiler from i386-pc-solaris2.10 and see if I can
reproduce the problem there.
Rainer
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41930
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug target/41930] [4.5 regression] cc1 SEGV compiling maxval_r16.c
2009-11-03 18:32 [Bug target/41930] New: [4.5 regression] cc1 SEGV compiling maxval_r16.c ro at gcc dot gnu dot org
2009-11-04 17:52 ` [Bug target/41930] " ro at CeBiTec dot Uni-Bielefeld dot DE
@ 2009-11-04 17:53 ` ro at gcc dot gnu dot org
2009-11-04 18:15 ` ro at CeBiTec dot Uni-Bielefeld dot DE
` (10 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: ro at gcc dot gnu dot org @ 2009-11-04 17:53 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from ro at gcc dot gnu dot org 2009-11-04 17:53 -------
Created an attachment (id=18968)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=18968&action=view)
minimized testcase
Compile with gcc -std=c99 -c -O2 to produce SEGV.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41930
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug target/41930] [4.5 regression] cc1 SEGV compiling maxval_r16.c
2009-11-03 18:32 [Bug target/41930] New: [4.5 regression] cc1 SEGV compiling maxval_r16.c ro at gcc dot gnu dot org
2009-11-04 17:52 ` [Bug target/41930] " ro at CeBiTec dot Uni-Bielefeld dot DE
2009-11-04 17:53 ` ro at gcc dot gnu dot org
@ 2009-11-04 18:15 ` ro at CeBiTec dot Uni-Bielefeld dot DE
2009-11-04 18:32 ` ro at gcc dot gnu dot org
` (9 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: ro at CeBiTec dot Uni-Bielefeld dot DE @ 2009-11-04 18:15 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from ro at CeBiTec dot Uni-Bielefeld dot DE 2009-11-04 18:15 -------
Subject: Re: [4.5 regression] cc1 SEGV compiling maxval_r16.c
> I'll build a cross compiler from i386-pc-solaris2.10 and see if I can
> reproduce the problem there.
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).
Rainer
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41930
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug target/41930] [4.5 regression] cc1 SEGV compiling maxval_r16.c
2009-11-03 18:32 [Bug target/41930] New: [4.5 regression] cc1 SEGV compiling maxval_r16.c ro at gcc dot gnu dot org
` (2 preceding siblings ...)
2009-11-04 18:15 ` ro at CeBiTec dot Uni-Bielefeld dot DE
@ 2009-11-04 18:32 ` ro at gcc dot gnu dot org
2009-11-04 18:35 ` ro at CeBiTec dot Uni-Bielefeld dot DE
` (8 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: ro at gcc dot gnu dot org @ 2009-11-04 18:32 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from ro at gcc dot gnu dot org 2009-11-04 18:32 -------
Richard, this may be due to your patch.
--
ro at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |rsandifo at gcc dot gnu dot
| |org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41930
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug target/41930] [4.5 regression] cc1 SEGV compiling maxval_r16.c
2009-11-03 18:32 [Bug target/41930] New: [4.5 regression] cc1 SEGV compiling maxval_r16.c ro at gcc dot gnu dot org
` (3 preceding siblings ...)
2009-11-04 18:32 ` ro at gcc dot gnu dot org
@ 2009-11-04 18:35 ` ro at CeBiTec dot Uni-Bielefeld dot DE
2009-11-06 8:44 ` [Bug middle-end/41930] " pinskia at gcc dot gnu dot org
` (7 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: ro at CeBiTec dot Uni-Bielefeld dot DE @ 2009-11-04 18:35 UTC (permalink / raw)
To: gcc-bugs
------- 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
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug middle-end/41930] [4.5 regression] cc1 SEGV compiling maxval_r16.c
2009-11-03 18:32 [Bug target/41930] New: [4.5 regression] cc1 SEGV compiling maxval_r16.c ro at gcc dot gnu dot org
` (4 preceding siblings ...)
2009-11-04 18:35 ` ro at CeBiTec dot Uni-Bielefeld dot DE
@ 2009-11-06 8:44 ` pinskia at gcc dot gnu dot org
2009-11-09 13:06 ` rguenth at gcc dot gnu dot org
` (6 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2009-11-06 8:44 UTC (permalink / raw)
To: gcc-bugs
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |pinskia at gcc dot gnu dot
| |org
Component|target |middle-end
Keywords| |build, ice-on-valid-code
Target Milestone|--- |4.5.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41930
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug middle-end/41930] [4.5 regression] cc1 SEGV compiling maxval_r16.c
2009-11-03 18:32 [Bug target/41930] New: [4.5 regression] cc1 SEGV compiling maxval_r16.c ro at gcc dot gnu dot org
` (5 preceding siblings ...)
2009-11-06 8:44 ` [Bug middle-end/41930] " pinskia at gcc dot gnu dot org
@ 2009-11-09 13:06 ` rguenth at gcc dot gnu dot org
2009-11-11 10:01 ` ubizjak at gmail dot com
` (5 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-11-09 13:06 UTC (permalink / raw)
To: gcc-bugs
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Priority|P3 |P4
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41930
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug middle-end/41930] [4.5 regression] cc1 SEGV compiling maxval_r16.c
2009-11-03 18:32 [Bug target/41930] New: [4.5 regression] cc1 SEGV compiling maxval_r16.c ro at gcc dot gnu dot org
` (6 preceding siblings ...)
2009-11-09 13:06 ` rguenth at gcc dot gnu dot org
@ 2009-11-11 10:01 ` ubizjak at gmail dot com
2009-11-11 10:38 ` ubizjak at gmail dot com
` (4 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: ubizjak at gmail dot com @ 2009-11-11 10:01 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from ubizjak at gmail dot com 2009-11-11 10:01 -------
(In reply to comment #3)
> Subject: Re: [4.5 regression] cc1 SEGV compiling maxval_r16.c
>
> > I'll build a cross compiler from i386-pc-solaris2.10 and see if I can
> > reproduce the problem there.
>
> 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).
Add --with-long-double-128 to your configure flags and it will also trigger
with a cross compiler.
Confirmed with a cross from x86_64-pc-linux-gnu.
--
ubizjak at gmail dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2009-11-11 10:01:06
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41930
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug middle-end/41930] [4.5 regression] cc1 SEGV compiling maxval_r16.c
2009-11-03 18:32 [Bug target/41930] New: [4.5 regression] cc1 SEGV compiling maxval_r16.c ro at gcc dot gnu dot org
` (7 preceding siblings ...)
2009-11-11 10:01 ` ubizjak at gmail dot com
@ 2009-11-11 10:38 ` ubizjak at gmail dot com
2009-11-11 11:10 ` ubizjak at gmail dot com
` (3 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: ubizjak at gmail dot com @ 2009-11-11 10:38 UTC (permalink / raw)
To: gcc-bugs
------- Comment #7 from ubizjak at gmail dot com 2009-11-11 10:37 -------
We recurse with:
simplify_replace_fn_rtx called, x =
(expr_list:REG_DEP_TRUE (symbol_ref:DI ("_OtsGeqX") [flags 0x41])
(expr_list:REG_DEP_TRUE (mem:TF (reg/f:DI 75 [ array_3(D)->data ]) [3 S16
A128])
(expr_list:REG_DEP_TRUE (reg:TF 76)
(nil))))
simplify_replace_fn_rtx called, x =
(symbol_ref:DI ("_OtsGeqX") [flags 0x41])
simplify_replace_fn_rtx called, x =
(expr_list:REG_DEP_TRUE (mem:TF (reg/f:DI 75 [ array_3(D)->data ]) [3 S16
A128])
(expr_list:REG_DEP_TRUE (reg:TF 76)
(nil)))
simplify_replace_fn_rtx called, x =
(mem:TF (reg/f:DI 75 [ array_3(D)->data ]) [3 S16 A128])
simplify_replace_fn_rtx called, x =
(reg/f:DI 75 [ array_3(D)->data ])
simplify_replace_fn_rtx called, x =
(expr_list:REG_DEP_TRUE (reg:TF 76)
(nil))
simplify_replace_fn_rtx called, x =
(reg:TF 76)
gcc dies in "case 'e':", recursing with (nil) from:
(expr_list:REG_DEP_TRUE (reg:TF 76)
(nil))
The fix is then trivial, like [no whitespace diff]:
--cut here--
Index: simplify-rtx.c
===================================================================
--- simplify-rtx.c (revision 154088)
+++ simplify-rtx.c (working copy)
@@ -489,6 +489,8 @@ simplify_replace_fn_rtx (rtx x, const_rt
break;
case 'e':
+ if (XEXP (x, i))
+ {
op = simplify_replace_fn_rtx (XEXP (x, i), old_rtx, fn, data);
if (op != XEXP (x, i))
{
@@ -496,6 +498,7 @@ simplify_replace_fn_rtx (rtx x, const_rt
newx = shallow_copy_rtx (x);
XEXP (newx, i) = op;
}
+ }
break;
}
return newx;
--cut here--
--
ubizjak at gmail dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |ubizjak at gmail dot com
|dot org |
Status|NEW |ASSIGNED
Last reconfirmed|2009-11-11 10:01:06 |2009-11-11 10:37:52
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41930
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug middle-end/41930] [4.5 regression] cc1 SEGV compiling maxval_r16.c
2009-11-03 18:32 [Bug target/41930] New: [4.5 regression] cc1 SEGV compiling maxval_r16.c ro at gcc dot gnu dot org
` (8 preceding siblings ...)
2009-11-11 10:38 ` ubizjak at gmail dot com
@ 2009-11-11 11:10 ` ubizjak at gmail dot com
2009-11-12 7:30 ` uros at gcc dot gnu dot org
` (2 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: ubizjak at gmail dot com @ 2009-11-11 11:10 UTC (permalink / raw)
To: gcc-bugs
------- Comment #8 from ubizjak at gmail dot com 2009-11-11 11:10 -------
Testing patch (it bootstraps OK on alpha-linux-gnu).
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41930
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug middle-end/41930] [4.5 regression] cc1 SEGV compiling maxval_r16.c
2009-11-03 18:32 [Bug target/41930] New: [4.5 regression] cc1 SEGV compiling maxval_r16.c ro at gcc dot gnu dot org
` (9 preceding siblings ...)
2009-11-11 11:10 ` ubizjak at gmail dot com
@ 2009-11-12 7:30 ` uros at gcc dot gnu dot org
2009-11-12 7:41 ` ubizjak at gmail dot com
2009-11-12 16:46 ` ro at techfak dot uni-bielefeld dot de
12 siblings, 0 replies; 14+ messages in thread
From: uros at gcc dot gnu dot org @ 2009-11-12 7:30 UTC (permalink / raw)
To: gcc-bugs
------- Comment #9 from uros at gcc dot gnu dot org 2009-11-12 07:30 -------
Subject: Bug 41930
Author: uros
Date: Thu Nov 12 07:30:05 2009
New Revision: 154116
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=154116
Log:
PR middle-end/41930
* simplify-rtx.c (simplify_replace_fn_rtx) <case 'e'>: Skip
processing if XEXP (x, i) is NULL.
Modified:
trunk/gcc/ChangeLog
trunk/gcc/simplify-rtx.c
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41930
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug middle-end/41930] [4.5 regression] cc1 SEGV compiling maxval_r16.c
2009-11-03 18:32 [Bug target/41930] New: [4.5 regression] cc1 SEGV compiling maxval_r16.c ro at gcc dot gnu dot org
` (10 preceding siblings ...)
2009-11-12 7:30 ` uros at gcc dot gnu dot org
@ 2009-11-12 7:41 ` ubizjak at gmail dot com
2009-11-12 16:46 ` ro at techfak dot uni-bielefeld dot de
12 siblings, 0 replies; 14+ messages in thread
From: ubizjak at gmail dot com @ 2009-11-12 7:41 UTC (permalink / raw)
To: gcc-bugs
------- Comment #10 from ubizjak at gmail dot com 2009-11-12 07:40 -------
Fixed.
--
ubizjak at gmail dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
URL| |http://gcc.gnu.org/ml/gcc-
| |patches/2009-
| |11/msg00562.html
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41930
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug middle-end/41930] [4.5 regression] cc1 SEGV compiling maxval_r16.c
2009-11-03 18:32 [Bug target/41930] New: [4.5 regression] cc1 SEGV compiling maxval_r16.c ro at gcc dot gnu dot org
` (11 preceding siblings ...)
2009-11-12 7:41 ` ubizjak at gmail dot com
@ 2009-11-12 16:46 ` ro at techfak dot uni-bielefeld dot de
12 siblings, 0 replies; 14+ messages in thread
From: ro at techfak dot uni-bielefeld dot de @ 2009-11-12 16:46 UTC (permalink / raw)
To: gcc-bugs
------- Comment #11 from ro at techfak dot uni-bielefeld dot de 2009-11-12 16:46 -------
Subject: Re: [4.5 regression] cc1 SEGV compiling maxval_r16.c
Bootstrap finishes with your patch on alpha-dec-osf5.1b; the testsuite is
still running.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41930
^ permalink raw reply [flat|nested] 14+ messages in thread