I;m running gcc-4.4.0 (built with default optimization flags, but with additional optimizations) and was testing it on ocrad-0.18 (admittedly with lots of optimization): I get g++ -march=pentium4 -msse2 -mfpmath=sse -O3 -ffast-math -funroll-loops -fomit-frame-pointer -floop-interchange -floop-strip-mine -floop-block -c -o track.o track.cc track.cc: In member function 'void Track::set_track(const std::vector<Rectangle, std::allocator<Rectangle> >&)': track.cc:219: internal compiler error: in vect_get_vec_def_for_operand, at tree-vect-transform.c:1999 I'll attach the preprocessed source separately.
Created attachment 17832 [details] Preprocessed source of source that triggers ICE
Reducing.
Confirmed.
Created attachment 17833 [details] reduced testcase
This is caused by revision 145494: http://gcc.gnu.org/ml/gcc-cvs/2009-04/msg00115.html
How can that be if the bug also happens on the 4.4 branch?
(In reply to comment #6) > How can that be if the bug also happens on the 4.4 branch? > The testcase in comment #4 compiles fine with gcc 4.4.1.
(In reply to comment #1) > Created an attachment (id=17832) [edit] > Preprocessed source of source that triggers ICE > This was introduced between revisions 138059 and 13934.
The original testcase failure fails with both 4.4.x and trunk and was introduced between 138524 and 138811. The reduced testcase only fails on the trunk, not on the 4.4 branch.
r138553 in particular. -O2 -ftree-vectorize -m32 -msse2 is needed to reproduce it.
It is caused by revision 138553: http://gcc.gnu.org/ml/gcc-cvs/2008-08/msg00112.html
Well, that revision only enabled vectorization support for more things... (which is probably what makes this a regression in the first place).
(In reply to comment #12) > Well, that revision only enabled vectorization support for more things... > (which is probably what makes this a regression in the first place). Right, I think it is something in the strided accesses detection. I am looking into it now.
I am testing: Index: tree-vect-data-refs.c =================================================================== --- tree-vect-data-refs.c (revision 147329) +++ tree-vect-data-refs.c (working copy) @@ -1424,7 +1424,7 @@ vect_analyze_group_access (struct data_r /* First stmt in the interleaving chain. Check the chain. */ gimple next = DR_GROUP_NEXT_DR (vinfo_for_stmt (stmt)); struct data_reference *data_ref = dr; - unsigned int count = 1; + unsigned int count = 1, gaps = 0; tree next_step; tree prev_init = DR_INIT (data_ref); gimple prev = stmt; @@ -1490,6 +1490,8 @@ vect_analyze_group_access (struct data_r fprintf (vect_dump, "interleaved store with gaps"); return false; } + + gaps += diff - 1; } /* Store the gap from the previous member of the group. If there is no @@ -1506,8 +1508,9 @@ vect_analyze_group_access (struct data_r the type to get COUNT_IN_BYTES. */ count_in_bytes = type_size * count; - /* Check that the size of the interleaving is not greater than STEP. */ - if (dr_step < count_in_bytes) + /* Check that the size of the interleaving (including gaps) is not greater + than STEP. */ + if (dr_step && dr_step < count_in_bytes + gaps * type_size) { if (vect_print_dump_info (REPORT_DETAILS)) { It fixes the reduced testcase, but I failed to compile the original one, so maybe someone could check that the above patch fixes the ICE for the original testcase? Thanks, Ira
(In reply to comment #14) > I am testing: > > Index: tree-vect-data-refs.c > =================================================================== > --- tree-vect-data-refs.c (revision 147329) > +++ tree-vect-data-refs.c (working copy) > @@ -1424,7 +1424,7 @@ vect_analyze_group_access (struct data_r > /* First stmt in the interleaving chain. Check the chain. */ > gimple next = DR_GROUP_NEXT_DR (vinfo_for_stmt (stmt)); > struct data_reference *data_ref = dr; > - unsigned int count = 1; > + unsigned int count = 1, gaps = 0; > tree next_step; > tree prev_init = DR_INIT (data_ref); > gimple prev = stmt; > @@ -1490,6 +1490,8 @@ vect_analyze_group_access (struct data_r > fprintf (vect_dump, "interleaved store with gaps"); > return false; > } > + > + gaps += diff - 1; > } > > /* Store the gap from the previous member of the group. If there is > no > @@ -1506,8 +1508,9 @@ vect_analyze_group_access (struct data_r > the type to get COUNT_IN_BYTES. */ > count_in_bytes = type_size * count; > > - /* Check that the size of the interleaving is not greater than STEP. */ > - if (dr_step < count_in_bytes) > + /* Check that the size of the interleaving (including gaps) is not > greater > + than STEP. */ > + if (dr_step && dr_step < count_in_bytes + gaps * type_size) > { > if (vect_print_dump_info (REPORT_DETAILS)) > { > > It fixes the reduced testcase, but I failed to compile the original one, so > maybe someone could check that the above patch fixes the ICE for the original > testcase? > It fixed the original testcase on 4.4 branch.
Subject: Bug 40074 Author: irar Date: Mon May 11 11:54:02 2009 New Revision: 147370 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=147370 Log: PR tree-optimization/40074 * tree-vect-analyze.c (vect_analyze_group_access): Take gaps into account in group size and step comparison. Added: branches/gcc-4_4-branch/gcc/testsuite/gcc.dg/vect/pr40074.c Modified: branches/gcc-4_4-branch/gcc/ChangeLog branches/gcc-4_4-branch/gcc/testsuite/ChangeLog branches/gcc-4_4-branch/gcc/tree-vect-analyze.c
Subject: Bug 40074 Author: irar Date: Mon May 11 12:33:13 2009 New Revision: 147372 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=147372 Log: PR tree-optimization/40074 * tree-vect-data-refs.c (vect_analyze_group_access): Take gaps into account in group size and step comparison. Added: trunk/gcc/testsuite/gcc.dg/vect/pr40074.c Modified: trunk/gcc/ChangeLog trunk/gcc/testsuite/ChangeLog trunk/gcc/tree-vect-data-refs.c
Fixed.