From 68cba9eee7fe480459a7277a38ab61f1b5fa2af6 Mon Sep 17 00:00:00 2001 From: Dorit Nuzman Date: Tue, 23 Oct 2007 19:50:18 +0000 Subject: re PR tree-optimization/33860 (ICE in vectorizable_load, at tree-vect-transform.c:5503) PR tree-optimization/33860 * tree-vect-transform.c (vect_analyze_data_ref_access): Don't allow interleaved accesses in case the dr is inside the inner-loop during outer-loop vectorization. From-SVN: r129587 --- gcc/ChangeLog | 7 +++++++ gcc/testsuite/ChangeLog | 7 +++++++ gcc/testsuite/g++.dg/vect/pr33860.cc | 25 +++++++++++++++++++++++++ gcc/testsuite/g++.dg/vect/pr33860a.cc | 25 +++++++++++++++++++++++++ gcc/tree-vect-analyze.c | 4 ++++ 5 files changed, 68 insertions(+) create mode 100644 gcc/testsuite/g++.dg/vect/pr33860.cc create mode 100644 gcc/testsuite/g++.dg/vect/pr33860a.cc (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9217faa..a8d8a9f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2007-10-23 Dorit Nuzman + + PR tree-optimization/33860 + * tree-vect-transform.c (vect_analyze_data_ref_access): Don't allow + interleaved accesses in case the dr is inside the inner-loop during + outer-loop vectorization. + 2007-10-23 Eric Botcazou * doc/rtl.texi (Flags): Fix MEM_SCALAR_P entry. diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 9a78b16..a1bf668 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2007-10-23 Martin Michlmayr + Dorit Nuzman + + PR tree-optimization/33860 + * g++.dg/vect/pr33860.cc: New test. + * g++.dg/vect/pr33860a.cc: New test. + 2007-10-23 Tehila Meyzels Revital Eres diff --git a/gcc/testsuite/g++.dg/vect/pr33860.cc b/gcc/testsuite/g++.dg/vect/pr33860.cc new file mode 100644 index 0000000..e70ec67 --- /dev/null +++ b/gcc/testsuite/g++.dg/vect/pr33860.cc @@ -0,0 +1,25 @@ +/* { dg-do compile } */ +/* Testcase by Martin Michlmayr */ + +class Matrix +{ + public: + double data[4][4]; + Matrix operator* (const Matrix matrix) const; + void makeRotationAboutVector (void); +}; +void Matrix::makeRotationAboutVector (void) +{ + Matrix irx; + *this = irx * (*this); +} +Matrix Matrix::operator* (const Matrix matrix) const +{ + Matrix ret; + for (int i = 0; i < 4; i++) + for (int j = 0; j < 4; j++) + ret.data[j][i] = matrix.data[j][2] + matrix.data[j][3]; + return ret; +} + +/* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/g++.dg/vect/pr33860a.cc b/gcc/testsuite/g++.dg/vect/pr33860a.cc new file mode 100644 index 0000000..a4f7bec --- /dev/null +++ b/gcc/testsuite/g++.dg/vect/pr33860a.cc @@ -0,0 +1,25 @@ +/* { dg-do compile } */ +/* Testcase by Martin Michlmayr */ + +class Matrix +{ + public: + float data[4][4] __attribute__ ((__aligned__(16))); + Matrix operator* (const Matrix matrix) const; + void makeRotationAboutVector (void); +}; +void Matrix::makeRotationAboutVector (void) +{ + Matrix irx; + *this = irx * (*this); +} +Matrix Matrix::operator* (const Matrix matrix) const +{ + Matrix ret; + for (int i = 0; i < 4; i++) + for (int j = 0; j < 4; j++) + ret.data[j][i] = matrix.data[j][2] + matrix.data[j][3]; + return ret; +} + +/* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/tree-vect-analyze.c b/gcc/tree-vect-analyze.c index b91fbc0..ff81f9d 100644 --- a/gcc/tree-vect-analyze.c +++ b/gcc/tree-vect-analyze.c @@ -2322,6 +2322,10 @@ vect_analyze_data_ref_access (struct data_reference *dr) if (nested_in_vect_loop_p (loop, stmt)) { + /* Interleaved accesses are not yet supported within outer-loop + vectorization for references in the inner-loop. */ + DR_GROUP_FIRST_DR (vinfo_for_stmt (stmt)) = NULL_TREE; + /* For the rest of the analysis we use the outer-loop step. */ step = STMT_VINFO_DR_STEP (stmt_info); dr_step = TREE_INT_CST_LOW (step); -- cgit v1.1