I just tried to compile lapack version 3.1.1 with the GNU Fortran compiler version 4.3 snapshot 20070914. The compiler said /home/dcb/gcc/20070914/results/bin/gfortran -g -O3 -Wall -ftree-vectorize -c dlarre.f -o dlarre.o dlarre.f: In function 'dlarre': dlarre.f:1: internal compiler error: Segmentation fault Please submit a full bug report, with preprocessed source if appropriate. See <http://gcc.gnu.org/bugs.html> for instructions. Here is some help from valgrind ==32315== Invalid read of size 4 ==32315== at 0xAB06EA: vect_get_vec_defs_for_stmt_copy (tree.h:210) ==32315== by 0xAB3CC5: vectorizable_operation (tree-vect-transform.c:3987) ==32315== by 0xAC058B: vect_transform_stmt (tree-vect-transform.c:6095) ==32315== by 0xAC1707: vect_transform_loop (tree-vect-transform.c:7334) ==32315== by 0x80766B: vectorize_loops (tree-vectorizer.c:2507) ==32315== by 0x64BCC8: execute_one_pass (passes.c:1115) ==32315== by 0x64BE9F: execute_pass_list (passes.c:1168) ==32315== by 0x64BEB4: execute_pass_list (passes.c:1169) ==32315== by 0x64BEB4: execute_pass_list (passes.c:1169) ==32315== by 0x72480F: tree_rest_of_compilation (tree-optimize.c:404) ==32315== by 0x893DD3: cgraph_expand_function (cgraphunit.c:1070) ==32315== by 0x896024: cgraph_optimize (cgraphunit.c:1139) ==32315== Address 0x0 is not stack'd, malloc'd or (recently) free'd dlarre.f: In function 'dlarre': dlarre.f:1: internal compiler error: Segmentation fault Source attached. Flags -O2 -ftree-vectorize required.
Created attachment 14214 [details] fortran source code
I'm not seeing this problem on powerpc-apple-darwin9. I am using a svn pull from gcc trunk that has the ICE fixes Dorit added in... r128514 | dorit | 2007-09-15 14:24:23 -0400 (Sat, 15 Sep 2007) | 7 lines * tree-vect-transform.c (vect_get_vec_defs_for_stmt_copy): check if the VEC is not NULL. (vectorizable_type_demotion, vectorizable_type_promotion): Check that get_vectype_for_scalar_type succeeded. (vectorizable_conversion): Likewise. You might want to try again with the current gcc trunk.
I can reproduce that on x86_64-linux with trunk rev. 128442. Severity set to critical, as this is LAPACK. Program received signal SIGSEGV, Segmentation fault. vect_get_vec_defs_for_stmt_copy (dt=0x7fff713d44c0, vec_oprnds0=0x7fff713d44b8, vec_oprnds1=0x7fff713d44b0) at ../../../trunk/gcc/tree.h:210 210 DEF_VEC_P(tree); (gdb) bt #0 vect_get_vec_defs_for_stmt_copy (dt=0x7fff713d44c0, vec_oprnds0=0x7fff713d44b8, vec_oprnds1=0x7fff713d44b0) at ../../../trunk/gcc/tree.h:210 #1 0x0000000000aacca6 in vectorizable_operation (stmt=0x2ac339ca5600, bsi=0x7fff713d4660, vec_stmt=0x7fff713d4528, slp_node=0x0) at ../../../trunk/gcc/tree-vect-transform.c:3987 #2 0x0000000000ab95d4 in vect_transform_stmt (stmt=0x2ac339ca5600, bsi=0x7fff713d4660, strided_store=0x7fff713d46cf "", slp_node=0x0) at ../../../trunk/gcc/tree-vect-transform.c:6095 #3 0x0000000000aba733 in vect_transform_loop (loop_vinfo=0x1091460) at ../../../trunk/gcc/tree-vect-transform.c:7334 #4 0x000000000080c28e in vectorize_loops () at ../../../trunk/gcc/tree-vectorizer.c:2507 #5 0x000000000064e261 in execute_one_pass (pass=0xe22180) at ../../../trunk/gcc/passes.c:1115 #6 0x000000000064e440 in execute_pass_list (pass=0xe22180) at ../../../trunk/gcc/passes.c:1168 #7 0x000000000064e455 in execute_pass_list (pass=0xe21fa0) at ../../../trunk/gcc/passes.c:1169 #8 0x000000000064e455 in execute_pass_list (pass=0xe213a0) at ../../../trunk/gcc/passes.c:1169 #9 0x00000000007286e8 in tree_rest_of_compilation (fndecl=0x2ac339c14340) at ../../../trunk/gcc/tree-optimize.c:404 Reduced testcase is: $ cat foo.f SUBROUTINE DLARRE (W, IBLOCK, WORK) INTEGER M, I INTEGER IBLOCK(*) DOUBLE PRECISION W(*), WORK(*) DO JBLK = 1, 10 DO I = 1, 10 M = M + 1 W(M) = -WORK(I) IBLOCK(M) = 0 END DO END DO END $ gfortran -O2 -ftree-vectorize foo.f foo.f: In function ‘dlarre’: foo.f:1: internal compiler error: Segmentation fault
(In reply to comment #3) > I can reproduce that on x86_64-linux with trunk rev. 128442. Dorit's fix is revision 128514, so it is not supposed to work on 128442... Anyway, I am trying to reproduce this ICE on x86_64-linux now, with the current trunk (128538). Ira
(In reply to comment #4) > Anyway, I am trying to reproduce this ICE on x86_64-linux now, with the current > trunk (128538). It doesn't ICE for me. (The loop gets vectorized). Ira
Subject: Bug 33449 Author: fxcoudert Date: Mon Sep 17 10:42:29 2007 New Revision: 128543 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=128543 Log: PR middle-end/33449 * gfortran.dg/pr33449.f90: New test. Added: trunk/gcc/testsuite/gfortran.dg/pr33449.f90 Modified: trunk/gcc/testsuite/ChangeLog
Closing the bug, after adding a reduced testcase to the testsuite.