]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR target/11693 ([ia64] ICE in gen_nop_type)
authorJakub Jelinek <jakub@redhat.com>
Mon, 11 Aug 2003 21:53:58 +0000 (23:53 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Mon, 11 Aug 2003 21:53:58 +0000 (23:53 +0200)
PR target/11693
* gcc.dg/20030811-1.c: New test.

PR target/11535
* gcc.c-torture/execute/20030811-1.c: New test.

From-SVN: r70339

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/execute/20030811-1.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/20030811-1.c [new file with mode: 0644]

index d4bd22d6b5aa73599302655119164e3d5b0c5a4b..aee5e84ad4a99b810c72eaabb38a92c2b8a51131 100644 (file)
@@ -1,3 +1,11 @@
+2003-08-11  Jakub Jelinek  <jakub@redhat.com>
+
+       PR target/11693
+       * gcc.dg/20030811-1.c: New test.
+
+       PR target/11535
+       * gcc.c-torture/execute/20030811-1.c: New test.
+
 2003-08-10  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
 
        * gcc.c-torture/execute/string-opt-9.c: Add more strcat cases.
diff --git a/gcc/testsuite/gcc.c-torture/execute/20030811-1.c b/gcc/testsuite/gcc.c-torture/execute/20030811-1.c
new file mode 100644 (file)
index 0000000..2ac59c0
--- /dev/null
@@ -0,0 +1,35 @@
+/* Origin: PR target/11535 from H. J. Lu <hjl@lucon.org> */
+
+void vararg (int i, ...)
+{
+  (void) i;
+}
+
+int i0[0], i1;
+
+void test1 (void)
+{
+  int a = (int) (long long) __builtin_return_address (0);
+  vararg (0, a);
+}
+
+void test2 (void)
+{
+  i0[0] = (int) (long long) __builtin_return_address (0);
+}
+
+void test3 (void)
+{
+  i1 = (int) (long long) __builtin_return_address (0);
+}
+
+void test4 (void)
+{
+  volatile long long a = (long long) __builtin_return_address (0);
+  i0[0] = (int) a;
+}
+
+int main (void)
+{
+  return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/20030811-1.c b/gcc/testsuite/gcc.dg/20030811-1.c
new file mode 100644 (file)
index 0000000..55b2406
--- /dev/null
@@ -0,0 +1,59 @@
+/* Origin: PR target/11693 from Andreas Schwab <schwab@suse.de> */
+/* { dg-do compile { target ia64-*-linux* } } */
+/* { dg-options "-O2 -frename-registers" } */
+
+static inline unsigned long
+foo (void)
+{
+  unsigned long x;
+  __asm__ __volatile__ ("" : "=r" (x) :: "memory");
+  return x;
+}
+
+static inline void
+bar (unsigned long x, unsigned long y)
+{
+  __asm__ __volatile__ ("" :: "r"(x), "r"(y) : "memory");
+}
+
+static inline void
+baz (unsigned long x, unsigned long y, unsigned long z, unsigned long p,
+     unsigned long q)
+{
+  __asm__ __volatile__ ("" :: "r" (q << 2) : "memory");
+  __asm__ __volatile__ ("" :: "r" (z) : "memory");
+  if (x & 0x1)
+    __asm__ __volatile__ ("" :: "r" (y), "r" (p) : "memory");
+  if (x & 0x2)
+    __asm__ __volatile__ ("" :: "r" (y), "r" (p) : "memory");
+}
+
+static inline unsigned long
+ffz (unsigned long x)
+{
+  unsigned long r;
+  __asm__ ("" : "=r" (r) : "r" (x & (~x - 1)));
+  return r;
+}
+
+void die (const char *, ...) __attribute__ ((noreturn));
+
+void
+test (void *x)
+{
+  unsigned long a, c;
+
+  a = foo ();
+  bar (0xc000000000000000, 0x660);
+  bar (0xa00000000000c000, 0x539);
+  baz (2, 1, 0xa000000000008000,
+       ({ unsigned long b;
+         b = ({ unsigned long d; __asm__ ("" : "=r" (d) : "r" (x)); d; })
+             + 0x10000000000661;
+         b;
+       }),
+       14);
+  c = ffz (0x1fffffffffffffff);
+  if (c < 51 || c > 61)
+    die ("die", c - 1);
+}