Hi,
  In some versions of GCC with AARCH64 backported, I got a miscompile
of a shift that involved a load which had a post increment of the
address.  This adds the testcase I created for that case.

Comitted after a quick test on x86_64-linux-gnu of the testcase.  I
had meant to commit this two days which is why the testcase is dated
two days ago.

Thanks,
Andrew Pinski

ChangeLog:
* gcc.c-torture/execute/20140828-1.c: New testcase.
Index: gcc.c-torture/execute/20140828-1.c
===================================================================
--- gcc.c-torture/execute/20140828-1.c  (revision 0)
+++ gcc.c-torture/execute/20140828-1.c  (revision 0)
@@ -0,0 +1,22 @@
+short *f(short *a, int b, int *d) __attribute__((noinline,noclone));
+
+short *f(short *a, int b, int *d)
+{
+  short c = *a;
+  a++;
+  c = b << c;
+  *d = c;
+  return a;
+}
+
+int main(void)
+{
+  int d;
+  short a[2];
+  a[0] = 0;
+  if (f(a, 1, &d) != &a[1])
+    __builtin_abort ();
+  if (d != 1)
+    __builtin_abort ();
+  return 0;
+}

Reply via email to