aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIra Rosen <irar@il.ibm.com>2008-04-24 14:21:45 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2008-04-24 14:21:45 +0000
commit2aa43509aefeccdde7bc02235c8337504da07b49 (patch)
tree20f5645c1cf1e8266945a05d8e0fa57a1f2e0129
parent22a812674cef168628bcf4760ef8faba4bb4cdb0 (diff)
downloadgcc-2aa43509aefeccdde7bc02235c8337504da07b49.zip
gcc-2aa43509aefeccdde7bc02235c8337504da07b49.tar.gz
gcc-2aa43509aefeccdde7bc02235c8337504da07b49.tar.bz2
re PR tree-optimization/36034 (wrong code vectorizing unrolled inner loop (SLP))
2008-04-24 Ira Rosen <irar@il.ibm.com> Richard Guenther <rguenther@suse.de> PR tree-optimization/36034 * tree-vect-analyze.c (vect_analyze_group_access): SLP is incapable of dealing with loads with gaps. * gcc.c-torture/execute/pr36034-1.c: New testcase. * gcc.c-torture/execute/pr36034-2.c: Likewise. Co-Authored-By: Richard Guenther <rguenther@suse.de> From-SVN: r134628
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/testsuite/ChangeLog7
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/pr36034-1.c32
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/pr36034-2.c32
-rw-r--r--gcc/tree-vect-analyze.c13
5 files changed, 87 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 3bd5e7f..e28f020 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2008-04-24 Ira Rosen <irar@il.ibm.com>
+ Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/36034
+ * tree-vect-analyze.c (vect_analyze_group_access): SLP is
+ incapable of dealing with loads with gaps.
+
2008-04-24 Rafael Espindola <espindola@google.com>
* tree-flow.h (vrp_evaluate_conditional): Change signature.
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 38e76fe..fa3768e 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,10 @@
+2008-04-24 Ira Rosen <irar@il.ibm.com>
+ Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/36034
+ * gcc.c-torture/execute/pr36034-1.c: New testcase.
+ * gcc.c-torture/execute/pr36034-2.c: Likewise.
+
2008-04-24 Olivier Hainque <hainque@adacore.com>
* gnat.dg/concat_length.adb: New test.
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr36034-1.c b/gcc/testsuite/gcc.c-torture/execute/pr36034-1.c
new file mode 100644
index 0000000..eddec57
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr36034-1.c
@@ -0,0 +1,32 @@
+double x[5][10] = { { 10, 11, 12, 13, 14, 15, -1, -1, -1, -1 },
+ { 21, 22, 23, 24, 25, 26, -1, -1, -1, -1 },
+ { 32, 33, 34, 35, 36, 37, -1, -1, -1, -1 },
+ { 43, 44, 45, 46, 47, 48, -1, -1, -1, -1 },
+ { 54, 55, 56, 57, 58, 59, -1, -1, -1, -1 } };
+double tmp[5][6];
+
+void __attribute__((noinline))
+test (void)
+{
+ int i, j;
+ for (i = 0; i < 5; ++i)
+ {
+ tmp[i][0] = x[i][0];
+ tmp[i][1] = x[i][1];
+ tmp[i][2] = x[i][2];
+ tmp[i][3] = x[i][3];
+ tmp[i][4] = x[i][4];
+ tmp[i][5] = x[i][5];
+ }
+}
+extern void abort (void);
+int main()
+{
+ int i, j;
+ test();
+ for (i = 0; i < 5; ++i)
+ for (j = 0; j < 6; ++j)
+ if (tmp[i][j] == -1)
+ abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr36034-2.c b/gcc/testsuite/gcc.c-torture/execute/pr36034-2.c
new file mode 100644
index 0000000..10abb79
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr36034-2.c
@@ -0,0 +1,32 @@
+double x[50] = { 10, 11, 12, 13, 14, 15, -1, -1, -1, -1,
+ 21, 22, 23, 24, 25, 26, -1, -1, -1, -1,
+ 32, 33, 34, 35, 36, 37, -1, -1, -1, -1,
+ 43, 44, 45, 46, 47, 48, -1, -1, -1, -1,
+ 54, 55, 56, 57, 58, 59, -1, -1, -1, -1 };
+double tmp[30];
+
+void __attribute__((noinline))
+test (void)
+{
+ int i, j;
+ for (i = 0; i < 5; ++i)
+ {
+ tmp[i*6] = x[i*10];
+ tmp[i*6+1] = x[i*10+1];
+ tmp[i*6+2] = x[i*10+2];
+ tmp[i*6+3] = x[i*10+3];
+ tmp[i*6+4] = x[i*10+4];
+ tmp[i*6+5] = x[i*10+5];
+ }
+}
+extern void abort (void);
+int main()
+{
+ int i, j;
+ test();
+ for (i = 0; i < 5; ++i)
+ for (j = 0; j < 6; ++j)
+ if (tmp[i*6+j] == -1)
+ abort ();
+ return 0;
+}
diff --git a/gcc/tree-vect-analyze.c b/gcc/tree-vect-analyze.c
index 26d8799..729ad79 100644
--- a/gcc/tree-vect-analyze.c
+++ b/gcc/tree-vect-analyze.c
@@ -2228,11 +2228,16 @@ vect_analyze_group_access (struct data_reference *dr)
/* Check that the size of the interleaving is equal to STEP for stores,
i.e., that there are no gaps. */
- if (!DR_IS_READ (dr) && dr_step != count_in_bytes)
+ if (dr_step != count_in_bytes)
{
- if (vect_print_dump_info (REPORT_DETAILS))
- fprintf (vect_dump, "interleaved store with gaps");
- return false;
+ if (DR_IS_READ (dr))
+ slp_impossible = true;
+ else
+ {
+ if (vect_print_dump_info (REPORT_DETAILS))
+ fprintf (vect_dump, "interleaved store with gaps");
+ return false;
+ }
}
/* Check that STEP is a multiple of type size. */