this night's trunk breaks building CP2K, testcase to be attached: > gfortran -c -O3 -ffast-math -funroll-loops -ftree-vectorize -march=native -v bug.f90 Using built-in specs. Target: x86_64-unknown-linux-gnu Configured with: /data/vondele/gcc_bench/gcc_trunk/gcc/configure --prefix=/data/vondele/gcc_bench/gcc_trunk/build --enable-languages=c,fortran Thread model: posix gcc version 4.4.0 20080819 (experimental) (GCC) COLLECT_GCC_OPTIONS='-c' '-O3' '-ffast-math' '-funroll-loops' '-ftree-vectorize' '-v' /data/vondele/gcc_bench/gcc_trunk/build/libexec/gcc/x86_64-unknown-linux-gnu/4.4.0/f951 bug.f90 -march=core2 -mcx16 -msahf --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=4096 -mtune=core2 -quiet -dumpbase bug.f90 -auxbase bug -O3 -version -ffast-math -funroll-loops -ftree-vectorize -fintrinsic-modules-path /data/vondele/gcc_bench/gcc_trunk/build/lib/gcc/x86_64-unknown-linux-gnu/4.4.0/finclude -o /tmp/ccNb5Smz.s GNU Fortran (GCC) version 4.4.0 20080819 (experimental) (x86_64-unknown-linux-gnu) compiled by GNU C version 4.4.0 20080819 (experimental), GMP version 4.2.2, MPFR version 2.3.1. GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096 bug.f90: In function ‘nmr_shift_print’: bug.f90:121: internal compiler error: in vinfo_for_stmt, at tree-vectorizer.h:546 Please submit a full bug report, with preprocessed source if appropriate. See <http://gcc.gnu.org/bugs.html> for instructions. most likely due to '2008-08-19 Ira Rosen <irar@il.ibm.com>'
Created attachment 16105 [details] testcase
I can trigger the same ICE with this testcase: --------------------------------------------------- int* getFoo(); struct Bar { Bar(); int* foo1; int* foo2; int* table[4][4][4]; }; Bar::Bar() { foo1 = getFoo(); foo2 = getFoo(); for (int a = 0; a < 4; ++a) { for (int b = 0; b < 4; ++b) { for (int c = 0; c < 4; ++c) { table[a][b][c] = foo1; } } } } -------------------------------------------------------- compile with: g++ -O3 bug.ii
I can confirm, SVN revision trunk@139225 is the first one with this bug.
I am testing the following patch: Index: tree-vect-analyze.c =================================================================== --- tree-vect-analyze.c (revision 139225) +++ tree-vect-analyze.c (working copy) @@ -2531,7 +2535,7 @@ vect_get_and_check_slp_defs (loop_vec_in /* Check if DEF_STMT is a part of a pattern and get the def stmt from the pattern. Check that all the stmts of the node are in the pattern. */ - if (def_stmt && vinfo_for_stmt (def_stmt) + if (def_stmt && dt[i] == vect_loop_def && vinfo_for_stmt (def_stmt) && STMT_VINFO_IN_PATTERN_P (vinfo_for_stmt (def_stmt))) { if (!*first_stmt_dt0) If everything goes OK, I will submit it tomorrow.
(In reply to comment #4) > I am testing the following patch: I checked that it fixed the problem with the original bug (PR37174.tgz) Thanks! > > Index: tree-vect-analyze.c > =================================================================== > --- tree-vect-analyze.c (revision 139225) > +++ tree-vect-analyze.c (working copy) > @@ -2531,7 +2535,7 @@ vect_get_and_check_slp_defs (loop_vec_in > /* Check if DEF_STMT is a part of a pattern and get the def stmt from > the pattern. Check that all the stmts of the node are in the > pattern. */ > - if (def_stmt && vinfo_for_stmt (def_stmt) > + if (def_stmt && dt[i] == vect_loop_def && vinfo_for_stmt (def_stmt) > && STMT_VINFO_IN_PATTERN_P (vinfo_for_stmt (def_stmt))) > { > if (!*first_stmt_dt0) > > If everything goes OK, I will submit it tomorrow. >
*** Bug 37198 has been marked as a duplicate of this bug. ***
Subject: Bug 37174 Author: irar Date: Sat Aug 23 10:42:34 2008 New Revision: 139508 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=139508 Log: PR tree-optimization/37174 * tree-vect-analyze.c (vect_get_and_check_slp_defs): Check that the def stmt is a part of the loop before accessing its stmt_vec_info. Added: trunk/gcc/testsuite/g++.dg/vect/pr37174.cc Modified: trunk/gcc/ChangeLog trunk/gcc/testsuite/ChangeLog trunk/gcc/tree-vect-analyze.c
Fixed.
*** Bug 37209 has been marked as a duplicate of this bug. ***