Current trunk and 4.1 branch ICE on powerpc-linux compiling mesa from SPEC CPU2000: elm3b11% /opt/gcc-nightly/4.1/bin/gcc -c -Os -ftree-loop-linear mesa1201.c mesa1201.c: In function ‘foo’: mesa1201.c:7: error: definition in block 9 does not dominate use in block 3 for SSA_NAME: q_25 in statement: q_1 = PHI <q_15(0), q_25(3)>; PHI argument q_25 for PHI node q_1 = PHI <q_15(0), q_25(3)>; mesa1201.c:7: internal compiler error: verify_ssa failed The testcase passes with GCC 4.0.2 and with the 4.0 branch. A regression hunt identified the following very large patch: http://gcc.gnu.org/viewcvs?view=rev&rev=102356 r102356 | irar | 2005-07-25 12:05:07 +0000 (Mon, 25 Jul 2005) I'll attach a minimized testcase.
Created attachment 10386 [details] minimized testcase
Looks related to PR 20256.
Confirmed also on i686-pc-linux-gnu.
I think the reason why this ICE occurs with my patch (http://gcc.gnu.org/viewcvs?view=rev&rev=102356) is that my patch enables data-refs analysis for INDIRECT_REFs. Similar ICE in PR 20256 happens also before my patch since the data-refs there are ARRAY_REFs, and ARRAY_REFs were already supported before.
I don't quite understand how likely we are to see this ICE; -Os -ftree-loop-linear seems like an obscure combination of flags. I'll call it P2 for now.
This issue will not be resolved in GCC 4.1.0; retargeted at GCC 4.1.1.
Fixed on the mainline by: 2006-05-17 Sebastian Pop <pop@cri.ensmp.fr> PR middle-end/20256 PR middle-end/26435 * tree-loop-linear.c (linear_transform_loops): Don't test perfect_nest_p. Call rewrite_into_loop_closed_ssa only when something changed. * lambda.h (gcc_loopnest_to_lambda_loopnest): Update declaration. * lambda-code.c (can_convert_to_perfect_nest): Declared. (gcc_loopnest_to_lambda_loopnest): Removed need_perfect_nest parameter. Test for perfect_nest_p here. Fix formating. (replace_uses_equiv_to_x_with_y): Fix formating. (stmt_uses_op): Removed. (can_convert_to_perfect_nest): Removed loopivs parameter. Complete the test by checking the scalar dependences. (perfect_nestify): Remove the test for can_convert_to_perfect_nest. Fix formating.
Will not be fixed in 4.1.1; adjust target milestone to 4.1.2.
Subject: Bug 25211 Author: spop Date: Thu Aug 17 13:14:26 2006 New Revision: 116223 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=116223 Log: PR middle-end/25211 PR middle-end/20256 PR middle-end/26435 * tree-loop-linear.c (linear_transform_loops): Don't test perfect_nest_p. Call rewrite_into_loop_closed_ssa only when something changed. * lambda.h (gcc_loopnest_to_lambda_loopnest): Update declaration. * lambda-code.c (can_convert_to_perfect_nest): Declared. (gcc_loopnest_to_lambda_loopnest): Removed need_perfect_nest parameter. Test for perfect_nest_p here. Fix formating. (replace_uses_equiv_to_x_with_y): Fix formating. (stmt_uses_op): Removed. (can_convert_to_perfect_nest): Removed loopivs parameter. Complete the test by checking the scalar dependences. (perfect_nestify): Remove the test for can_convert_to_perfect_nest. Fix formating. Don't copy statements in the inner loop: move them to the inner loop header. Added: branches/gcc-4_1-branch/gcc/testsuite/gcc.dg/tree-ssa/pr20256.c branches/gcc-4_1-branch/gcc/testsuite/gcc.dg/tree-ssa/pr26435.c branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/pr27745.f90 Modified: branches/gcc-4_1-branch/gcc/ChangeLog branches/gcc-4_1-branch/gcc/lambda-code.c branches/gcc-4_1-branch/gcc/lambda.h branches/gcc-4_1-branch/gcc/testsuite/gcc.dg/tree-ssa/ltrans-1.c branches/gcc-4_1-branch/gcc/tree-loop-linear.c
Fixed.