This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/29290] New: SPEC CPU2000 178.galgel ICE using -O3 -ftree-loop-linear
- From: "bergner at vnet dot ibm dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 29 Sep 2006 18:05:32 -0000
- Subject: [Bug tree-optimization/29290] New: SPEC CPU2000 178.galgel ICE using -O3 -ftree-loop-linear
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The following simplified test case from galgel SEGV's when using -O3
-ftree-loop-linear with the latest gcc-4_1-branch. It compiles fine with both
mainline and the gcc_4_1_1_release branch.
vervain% cat grsyst.f
Subroutine Diffun (A, B, NS, N)
Real*8 A, B
Integer NS, N
Dimension A(NS,NS), B(NS,NS)
A(1:N,1:N) = B(1:N,1:N)
End
vervain:% gfortran -O3 -ftree-loop-linear -S grsyst.f
grsyst.f: In function ?diffun?:
grsyst.f:1: 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.
Here's a backtrace that shows we take the SEGV due to a null pointer
dereference in exit_phi_for_loop_p() because loop->single_exit is null.
(gdb) bt
#0 exit_phi_for_loop_p (loop=0x1078ab20, stmt=0x400dfa00) at
tree-flow-inline.h:172
#1 0x10527a90 in gcc_loopnest_to_lambda_loopnest (currloops=0x10763578,
loop_nest=0x1078ab20, inductionvars=0xffffdb78,
invariants=0xffffdb7c) at /home/bergner/gcc/gcc-4.1/gcc/lambda-code.c:2242
#2 0x1050fa70 in linear_transform_loops (loops=0x10763578) at
/home/bergner/gcc/gcc-4.1/gcc/tree-loop-linear.c:338
#3 0x1046f4d0 in tree_linear_transform () at
/home/bergner/gcc/gcc-4.1/gcc/tree-ssa-loop.c:225
#4 0x1038beb4 in execute_one_pass (pass=0x106dad60) at
/home/bergner/gcc/gcc-4.1/gcc/passes.c:827
#5 0x1038bffc in execute_pass_list (pass=0x106dad60) at
/home/bergner/gcc/gcc-4.1/gcc/passes.c:859
#6 0x1038c014 in execute_pass_list (pass=0x106dae64) at
/home/bergner/gcc/gcc-4.1/gcc/passes.c:860
#7 0x1038c014 in execute_pass_list (pass=0x106d609c) at
/home/bergner/gcc/gcc-4.1/gcc/passes.c:860
#8 0x100985b4 in tree_rest_of_compilation (fndecl=0x400ec300) at
/home/bergner/gcc/gcc-4.1/gcc/tree-optimize.c:419
#9 0x10060fb8 in gfc_expand_function (fndecl=0x400ec300) at
/home/bergner/gcc/gcc-4.1/gcc/fortran/f95-lang.c:223
#10 0x103e6c8c in cgraph_expand_function (node=0x400e9850) at
/home/bergner/gcc/gcc-4.1/gcc/cgraphunit.c:1058
#11 0x103e8a08 in cgraph_optimize () at
/home/bergner/gcc/gcc-4.1/gcc/cgraphunit.c:1124
#12 0x100664cc in gfc_be_parse_file (set_yydebug=276343584) at
/home/bergner/gcc/gcc-4.1/gcc/fortran/f95-lang.c:293
#13 0x10350bb4 in toplev_main (argc=275644416, argv=0x1073a2e4) at
/home/bergner/gcc/gcc-4.1/gcc/toplev.c:991
#14 0x100943bc in main (argc=276343584, argv=0x400dfa00) at
/home/bergner/gcc/gcc-4.1/gcc/main.c:35
(gdb) list exit_phi_for_loop_p
2181
2182 static bool
2183 exit_phi_for_loop_p (struct loop *loop, tree stmt)
2184 {
2185
2186 if (TREE_CODE (stmt) != PHI_NODE
2187 || PHI_NUM_ARGS (stmt) != 1
2188 || bb_for_stmt (stmt) != loop->single_exit->dest)
2189 return false;
2190
(gdb) p loop->single_exit
$1 = 0x0
--
Summary: SPEC CPU2000 178.galgel ICE using -O3 -ftree-loop-linear
Product: gcc
Version: 4.1.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: tree-optimization
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: bergner at vnet dot ibm dot com
GCC build triplet: powerpc64-linux
GCC host triplet: powerpc64-linux
GCC target triplet: powerpc64-linux
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29290