aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pr29581-4.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2006-11-15 10:35:34 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2006-11-15 10:35:34 +0100
commit08700251e57a6fe9133fe77a31b098a99abd26e8 (patch)
tree98699616c4062e9e81d2c10336ff645e90ced992 /gcc/testsuite/gcc.dg/pr29581-4.c
parentd6cfd93133a6b3c3b32d98c6087e90c6b6be2685 (diff)
downloadgcc-08700251e57a6fe9133fe77a31b098a99abd26e8.zip
gcc-08700251e57a6fe9133fe77a31b098a99abd26e8.tar.gz
gcc-08700251e57a6fe9133fe77a31b098a99abd26e8.tar.bz2
re PR tree-optimization/29581 (Latent bug in 4.1/4.2/4.3 lambda-code.c)
PR tree-optimization/29581 * lambda-code.c (replace_uses_equiv_to_x_with_y): Add YINIT, REPLACEMENTS, FIRSTBSI arguments. If initial condition or type is different between Y and USE, create a temporary variable, initialize it at the beginning of the body bb and use it as replacement instead of Y. * gcc.dg/pr29581-1.c: New test. * gcc.dg/pr29581-2.c: New test. * gcc.dg/pr29581-3.c: New test. * gcc.dg/pr29581-4.c: New test. * gfortran.dg/pr29581.f90: New test. From-SVN: r118848
Diffstat (limited to 'gcc/testsuite/gcc.dg/pr29581-4.c')
-rw-r--r--gcc/testsuite/gcc.dg/pr29581-4.c48
1 files changed, 48 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/pr29581-4.c b/gcc/testsuite/gcc.dg/pr29581-4.c
new file mode 100644
index 0000000..c2d894c
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr29581-4.c
@@ -0,0 +1,48 @@
+/* PR tree-optimization/29581 */
+/* Origin: gcc.dg/vect/vect-88.c */
+/* { dg-do run } */
+/* { dg-options "-O2 -ftree-loop-linear" } */
+
+extern void abort (void);
+
+#define N 16
+
+int main1 (int n, int *a)
+{
+ int i, j, k;
+ int b[N];
+
+ for (i = 0; i < n; i++)
+ {
+ for (j = 0; j < n; j++)
+ {
+ k = i + n;
+ a[j] = k;
+ }
+ b[i] = k;
+ }
+
+
+ for (j = 0; j < n; j++)
+ if (a[j] != i + n - 1)
+ abort();
+
+ for (j = 0; j < n; j++)
+ if (b[j] != j + n)
+ abort();
+
+ return 0;
+}
+
+int main (void)
+{
+ int a[N+1] __attribute__ ((__aligned__(16)));
+
+ main1 (N, a+1);
+ main1 (0, a+1);
+ main1 (1, a+1);
+ main1 (2, a+1);
+ main1 (N-1, a+1);
+
+ return 0;
+}