aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2008-11-03 12:32:52 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2008-11-03 12:32:52 +0000
commitda4b6efcd6ed9d2c6f3b100dc8552753276df586 (patch)
tree80c65546172fbb0171b4c185c1f162c7571929c7 /gcc
parent2a81fe20dd558aef586fb7aa5c53779e129bc961 (diff)
downloadgcc-da4b6efcd6ed9d2c6f3b100dc8552753276df586.zip
gcc-da4b6efcd6ed9d2c6f3b100dc8552753276df586.tar.gz
gcc-da4b6efcd6ed9d2c6f3b100dc8552753276df586.tar.bz2
re PR tree-optimization/37573 (gcc-4.4 regression: incorrect code generation with -O1 -ftree-vectorize)
2008-11-03 Richard Guenther <rguenther@suse.de> PR middle-end/37573 * tree-data-ref.c (split_constant_offset_1): Fix tuplification. * gcc.c-torture/execute/pr37573.c: New testcase. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r141547
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/testsuite/ChangeLog6
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/pr37573.c65
-rw-r--r--gcc/tree-data-ref.c1
4 files changed, 77 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 6489e91..9a3d1bd 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2008-11-03 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/37573
+ * tree-data-ref.c (split_constant_offset_1): Fix tuplification.
+
2008-11-03 Jakub Jelinek <jakub@redhat.com>
PR middle-end/37858
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 1d7e58b..104f203 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2008-11-03 Richard Guenther <rguenther@suse.de>
+ Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/37573
+ * gcc.c-torture/execute/pr37573.c: New testcase.
+
2008-11-03 Jakub Jelinek <jakub@redhat.com>
PR middle-end/37858
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr37573.c b/gcc/testsuite/gcc.c-torture/execute/pr37573.c
new file mode 100644
index 0000000..5891910
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr37573.c
@@ -0,0 +1,65 @@
+/* PR tree-optimization/37573 */
+
+struct S
+{
+ unsigned int *a;
+ unsigned int b;
+ unsigned int c[624];
+};
+
+static unsigned char __attribute__((noinline))
+foo (struct S *s)
+{
+ unsigned int r;
+ if (!--s->b)
+ {
+ unsigned int *c = s->c;
+ unsigned int i;
+ s->a = c;
+ for (i = 0; i < 227; i++)
+ c[i] = ((((c[i] ^ c[i + 1]) & 0x7ffffffe) ^ c[i]) >> 1)
+ ^ ((0 - (c[i + 1] & 1)) & 0x9908b0df) ^ c[i + 397];
+ }
+ r = *(s->a++);
+ r ^= (r >> 11);
+ r ^= ((r & 0xff3a58ad) << 7);
+ r ^= ((r & 0xffffdf8c) << 15);
+ r ^= (r >> 18);
+ return (unsigned char) (r >> 1);
+}
+
+static void __attribute__((noinline))
+bar (unsigned char *p, unsigned int q, unsigned int r)
+{
+ struct S s;
+ unsigned int i;
+ unsigned int *c = s.c;
+ *c = r;
+ for (i = 1; i < 624; i++)
+ c[i] = i + 0x6c078965 * ((c[i - 1] >> 30) ^ c[i - 1]);
+ s.b = 1;
+ while (q--)
+ *p++ ^= foo (&s);
+};
+
+static unsigned char p[23] = {
+ 0xc0, 0x49, 0x17, 0x32, 0x62, 0x1e, 0x2e, 0xd5, 0x4c, 0x19, 0x28, 0x49,
+ 0x91, 0xe4, 0x72, 0x83, 0x91, 0x3d, 0x93, 0x83, 0xb3, 0x61, 0x38
+};
+
+static unsigned char q[23] = {
+ 0x3e, 0x41, 0x55, 0x54, 0x4f, 0x49, 0x54, 0x20, 0x55, 0x4e, 0x49, 0x43,
+ 0x4f, 0x44, 0x45, 0x20, 0x53, 0x43, 0x52, 0x49, 0x50, 0x54, 0x3c
+};
+
+int
+main (void)
+{
+ unsigned int s;
+ s = 23;
+ bar (p, s, s + 0xa25e);
+ if (__builtin_memcmp (p, q, s) != 0)
+ __builtin_abort ();
+ return 0;
+}
+
diff --git a/gcc/tree-data-ref.c b/gcc/tree-data-ref.c
index 9412414..4f1a9fd 100644
--- a/gcc/tree-data-ref.c
+++ b/gcc/tree-data-ref.c
@@ -551,6 +551,7 @@ split_constant_offset_1 (tree type, tree op0, enum tree_code code, tree op1,
enum machine_mode pmode;
int punsignedp, pvolatilep;
+ op0 = TREE_OPERAND (op0, 0);
if (!handled_component_p (op0))
return false;