This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/13653] [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase
- From: "rguenth at tat dot physik dot uni-tuebingen dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 24 May 2004 13:06:29 -0000
- Subject: [Bug rtl-optimization/13653] [3.3 regression] -O2 -funroll-loop miscompiles POOMA testcase
- References: <20040112101346.13653.rguenth@tat.physik.uni-tuebingen.de>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From rguenth at tat dot physik dot uni-tuebingen dot de 2004-05-24 13:06 -------
Subject: Re: [3.3 regression] -O2 -funroll-loop
miscompiles POOMA testcase
While the patch fixes a lot of regressions, I get now (now that I
again run a full regression test on POOMA with gcc-3.3, the last
was from Feb02) segfaults in the loop optimizer. The oldest binary I
can reproduce this is from Apr29, the last ok version I have is Mar01.
The segfaults look like:
Program received signal SIGSEGV, Segmentation fault.
0x0827c3e5 in ggc_set_mark (p=0x94d8988) at
/home/rguenth/src/gcc/gcc3.3/gcc/ggc-page.c:525
525 L2 = LOOKUP_L2 (p);
(gdb) bt
#0 0x0827c3e5 in ggc_set_mark (p=0x94d8988) at
/home/rguenth/src/gcc/gcc3.3/gcc/ggc-page.c:525
#1 0x083382b0 in gt_ggc_r_gt_alias_h ()
#2 0x080dcc14 in gt_ggc_ma_alias_invariant (x_p=0x9) at gt-alias.h:47
#3 0x081612c7 in ggc_mark_roots () at
/home/rguenth/src/gcc/gcc3.3/gcc/ggc-common.c:124
#4 0x0827ca75 in ggc_collect () at
/home/rguenth/src/gcc/gcc3.3/gcc/ggc-page.c:1727
#5 0x081eaa4b in loop_optimize (f=0x4fcf470c, dumpfile=0x0, flags=1)
at /home/rguenth/src/gcc/gcc3.3/gcc/loop.c:558
#6 0x08263cba in rest_of_compilation (decl=0x469e77e0)
at /home/rguenth/src/gcc/gcc3.3/gcc/toplev.c:2947
#7 0x080b908e in genrtl_finish_function (fn=0x469e77e0)
at /home/rguenth/src/gcc/gcc3.3/gcc/cp/semantics.c:2589
#8 0x080b8dbd in expand_body (fn=0x469e77e0)
at /home/rguenth/src/gcc/gcc3.3/gcc/cp/semantics.c:2412
#9 0x08077688 in instantiate_decl (d=0x0, defer_ok=0)
at /home/rguenth/src/gcc/gcc3.3/gcc/cp/pt.c:10578
#10 0x080779d0 in instantiate_pending_templates ()
at /home/rguenth/src/gcc/gcc3.3/gcc/cp/pt.c:10655
#11 0x08087abf in finish_file () at
/home/rguenth/src/gcc/gcc3.3/gcc/cp/decl2.c:2807
#12 0x08091dac in yyparse () at parse.y:489
#13 0x080d36e9 in c_common_parse_file (set_yydebug=0)
at /home/rguenth/src/gcc/gcc3.3/gcc/c-lex.c:159
#14 0x08261f9a in compile_file () at
/home/rguenth/src/gcc/gcc3.3/gcc/toplev.c:2130
#15 0x08267127 in do_compile () at
/home/rguenth/src/gcc/gcc3.3/gcc/toplev.c:5414
#16 0x082671bb in toplev_main (argc=0, argv=0x0)
at /home/rguenth/src/gcc/gcc3.3/gcc/toplev.c:5444
#17 0x080d93cb in main (argc=0, argv=0x0) at
/home/rguenth/src/gcc/gcc3.3/gcc/main.c:35
#18 0x4003b8ae in __libc_start_main () from /lib/libc.so.6
(gdb) up 5
#5 0x081eaa4b in loop_optimize (f=0x4fcf470c, dumpfile=0x0, flags=1)
at /home/rguenth/src/gcc/gcc3.3/gcc/loop.c:558
558 ggc_collect ();
(gdb) list
553 struct loop *loop = &loops->array[i];
554
555 if (! loop->invalid && loop->end)
556 {
557 scan_loop (loop, flags);
558 ggc_collect ();
559 }
560 }
561
562 end_alias_analysis ();
(gdb) up 3
#8 0x080b8dbd in expand_body (fn=0x469e77e0)
at /home/rguenth/src/gcc/gcc3.3/gcc/cp/semantics.c:2412
2412 genrtl_finish_function (fn);
(gdb) debug_tree(fn)
Undefined command: "debug". Try "help".
(gdb) call debug_tree(fn)
<function_decl 0x469e77e0 calcGCFillList
type <method_type 0x469dc1c0
type <void_type 0x4016ac40 void asm_written type_6 VOID
align 8 symtab 0 alias set -1
pointer_to_this <pointer_type 0x4016acb0>>
DI
size <integer_cst 0x4015d920 constant 64>
unit size <integer_cst 0x4015db40 constant 8>
align 64 symtab 0 alias set -1 method basetype <record_type
0x46853e00 GridLayoutData<2>>
arg-types <tree_list 0x469dbed8 side-effects value <pointer_type
0x46853ee0>
chain <tree_list 0x4015ef64 tree_2 value <void_type 0x4016ac40
void>>>
pointer_to_this <pointer_type 0x47adbd20>>
addressable asm_written used public private static weak decl_1 decl_5
QI file
/net/bellatrix/home/rguenth/src/pooma-bk/r2/src/Layout/GridLayout.cpp line
350 context <record_type 0x46853e00 GridLayoutData<2>>
arguments <parm_decl 0x4fb531c0 this
type <pointer_type 0x46a45a10 type <record_type 0x46853e00
GridLayoutData<2>>
readonly unsigned SI
size <integer_cst 0x4015dba0 constant 32>
unit size <integer_cst 0x4015dc00 constant 4>
align 32 symtab 152330360 alias set -1>
readonly unsigned used SI file
/net/bellatrix/home/rguenth/src/pooma-bk/r2/src/Layout/GridLayout.cpp line
350 size <integer_cst 0x4015dba0 32> unit size <integer_cst 0x4015dc00 4>
align 32 context <function_decl 0x469e77e0 calcGCFillList> initial
<pointer_type 0x46a45a10>
(reg/v/u/f:SI 58) arg-type <pointer_type 0x46a45a10>
incoming-rtl (mem/u/f:SI (reg/f:SI 16 argp) [116 this+0 S4 A32])>
result <result_decl 0x4fb53230 type <void_type 0x4016ac40 void>
VOID file
/net/bellatrix/home/rguenth/src/pooma-bk/r2/src/Layout/GridLayout.cpp line
350
align 8 context <function_decl 0x469e77e0 calcGCFillList>> initial
<block 0x4f7a4ef4>
template-info 0x469e8438
(mem:QI (symbol_ref/i:SI
("_ZN14GridLayoutDataILi2EE14calcGCFillListEv")) [0 S1 A8]) chain
<function_decl 0x469e7930 calcDomains>>
(gdb) c
Continuing.
/net/bellatrix/home/rguenth/src/pooma-bk/r2/src/Layout/GridLayout.cpp: In
member function `void GridLayoutData<Dim>::calcGCFillList() [with int
Dim =
2]':
/net/bellatrix/home/rguenth/src/pooma-bk/r2/src/Layout/GridLayout.cpp:201:
instantiated from `void GridLayoutData<Dim>::initialize(const
Interval<Dim>&, const Partitioner&, const ContextMapper<Dim>&) [with
Partitioner = GridPartition<2>, int Dim = 2]'
/net/bellatrix/home/rguenth/src/pooma-bk/r2/src/Layout/GridLayout.cpp:96:
instantiated from `GridLayoutData<Dim>::GridLayoutData(const
Interval<Dim>&, const Partitioner&, const ContextMapper<Dim>&) [with
Partitioner = GridPartition<2>, int Dim = 2]'
/net/bellatrix/home/rguenth/src/pooma-bk/r2/src/Layout/GridLayout.cpp:1428:
instantiated from `GridLayout<Dim>::GridLayout(typename
GridLayoutData<Dim>::Domain_t&, const Partitioner&, const ReplicatedTag&)
[with Partitioner = GridPartition<2>, int Dim = 2]'
/net/bellatrix/home/rguenth/src/pooma-bk/r2/src/Engine/tests/gmp_test4.cpp:103:
instantiated from here
/net/bellatrix/home/rguenth/src/pooma-bk/r2/src/Layout/GridLayout.cpp:484:
internal compiler error: Segmentation
fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
the suggested changes to REGNO_LAST_LUID/REGNO_LAST_NOTE_LUID are
applied, and the following hunk, whose origin I don't remember (but I
don't think they are in the Apr29 build):
diff -u -u -r1.433.2.13 loop.c
--- loop.c 29 Jan 2004 04:42:15 -0000 1.433.2.13
+++ loop.c 24 May 2004 12:52:56 -0000
@@ -4709,7 +4709,8 @@
does not have a valid INSN_LUID. */
&& ! bl->reversed
&& v->always_executed && ! v->maybe_multiple
- && INSN_UID (v->insn) < max_uid_for_loop)
+ && INSN_UID (v->insn) < max_uid_for_loop
+ && !loop->top)
{
/* If other giv's have been combined with this one, then
this will work only if all uses of the other giv's occur
(also of course my leafify patch in the gcc 3.3 incarnation, but
disabling leafify does not cure the problem).
Preprocessed testcase is at
http://www.tat.physik.uni-tuebingen.de/~rguenth/gcc/gmp_test4.ii.gz
Richard.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13653