+2007-08-22 Uros Bizjak <ubizjak@gmail.com>
+
+ * gcc.dg/20000724-1.c, gcc.dg/980312-1.c, gcc.dg/980313-1.c,
+ gcc.dg/attr-returns_twice-1.c, gcc.dg/inline-mcpy.c, gcc.dg/pr25196.c,
+ gcc.dg/pr25993.c, gcc.dg/pr26449.c, gcc.dg/pr28839.c,
+ gcc.dg/pr32191.c: Move to gcc.target/i386 directory.
+ * gcc.target/i386/pr31854.c, gcc.target/i386/pr32065-1.c,
+ gcc.target/i386/pr32065-2.c: Use dg-require-effective-target dfp.
+
2007-08-22 Richard Guenther <rguenther@suse.de>
PR middle-end/33007
+++ /dev/null
-/* { dg-do run { target i?86-*-linux* x86_64-*-linux* } } */
-/* { dg-options "-O2 -fomit-frame-pointer" } */
-/* { dg-require-effective-target ilp32 } */
-
-extern void abort (void);
-extern void exit (int);
-
-struct s {
- struct { int a; } a;
- int b;
- struct { struct { int a; } a; struct t { struct t *a, *b; } b; } c;
-};
-
-int bar(int (*fn)(void *), void *arg, unsigned long flags)
-{
- return 0;
-}
-
-int baz(void *x)
-{
- return 0;
-}
-
-void do_check (struct s *) asm ("do_check") __attribute__((regparm(1)));
-
-void __attribute__((regparm(1))) do_check(struct s *x)
-{
- if (x->a.a || x->b || x->c.a.a)
- abort();
- if (x->c.b.a != &x->c.b || x->c.b.b != &x->c.b)
- abort();
-}
-
-#define NT "\n\t"
-
-asm ("\n"
-"___checkme:"
-NT "pushl %eax; pushl %ebx; pushl %ecx; pushl %edx; pushl %esi; pushl %edi"
-
-NT "pushl $0; pushl $0; pushl $0; pushl $0; pushl $0"
-NT "pushl $0; pushl $0; pushl $0; pushl $0; pushl $0"
-
-NT "movl %ecx, %eax"
-NT "call do_check"
-
-NT "popl %eax; popl %eax; popl %eax; popl %eax; popl %eax"
-NT "popl %eax; popl %eax; popl %eax; popl %eax; popl %eax"
-
-NT "popl %edi; popl %esi; popl %edx; popl %ecx; popl %ebx; popl %eax"
-NT "ret"
-);
-
-extern inline void do_asm(struct s * x)
-{
- asm volatile("call ___checkme" : : "c" (x) : "memory");
-}
-
-int foo(void)
-{
- struct s x = { { 0 }, 0, { { 0 }, { &x.c.b, &x.c.b } } };
- bar(baz, &x, 1);
- do_asm(&x);
- bar(baz, &x, 1);
- do_asm(&x);
- return 0;
-}
-
-int main()
-{
- foo();
- exit(0);
-}
+++ /dev/null
-/* { dg-do link { target i?86-*-* x86_64-*-* } } */
-/* { dg-require-effective-target ilp32 } */
-/* { dg-options "-O2 -march=pentiumpro" } */
-
-extern __inline double
-__expm1 (double __x)
-{
- double __temp;
- __temp = 1.0;
- return __temp;
-}
-extern __inline double
-__sgn1 (double __x)
-{
- return __x >= 0.0 ? 1.0 : -1.0;
-}
-double
-tanh (double __x)
-{
- return __expm1 (__x) * __sgn1 (-__x);
-}
-main ()
-{
- return tanh (3.45) != 0;
-}
+++ /dev/null
-/* { dg-do link { target i?86-*-* x86_64-*-* } } */
-/* { dg-require-effective-target ilp32 } */
-/* { dg-options "-O2 -march=pentiumpro" } */
-
-extern __inline double
-__expm1 (double __x)
-{
- double __temp;
- __temp -= 1.0;
- return __temp;
-}
-extern __inline double
-__sgn1 (double __x)
-{
- return __x >= 0.0 ? 1.0 : -1.0;
-}
-double
-tanh (double __x)
-{
- register double __exm1 = __expm1 (__x);
- return __exm1 / (__exm1 + 2.0) * __sgn1 (-__x);
-}
-main ()
-{
- return tanh (3.45) != 0;
-}
+++ /dev/null
-/* { dg-do compile { target i?86-*-* x86_64-*-* } } */
-/* { dg-options "-Wclobbered" } */
-
-int newsetjmp(void) __attribute__((returns_twice));
-void g(int);
-
-int
-main (void)
-{
- register int reg asm ("esi") = 1; /* { dg-warning "might be clobbered" "" } */
-
- if (!newsetjmp ())
- {
- reg = 2;
- g (reg);
- }
- else
- {
- g (reg);
- }
-
- return 0;
-}
+++ /dev/null
-/* Test if we inline memcpy even with -Os, when the user requested it. */
-/* Don't name this test with memcpy in its name, otherwise the scan-assembler
- would be confused. */
-/* { dg-do compile { target i?86-*-linux* x86_64-*-linux* } } */
-/* { dg-options "-Os -minline-all-stringops" } */
-/* { dg-final { scan-assembler-not "memcpy" } } */
-char f(int i)
-{
- char *ram_split[] = { "5:3", "3:1", "1:1", "3:5" };
- return ram_split[i][0];
-}
+++ /dev/null
-/* { dg-do run { target i?86-*-* x86_64-*-* } } */
-/* { dg-require-effective-target ilp32 } */
-/* { dg-options "-march=i386 -O3 -fomit-frame-pointer" } */
-
-/* For this test case, we used to do an invalid load motion after
- reload, because we missed autoincrements of the stack pointer. */
-
-extern void abort (void);
-
-static int j;
-
-static void __attribute__((noinline))
-f1 (int a, int b, int c, int d, int e)
-{
- j = a;
-}
-
-int __attribute__((noinline))
-f2 (int a, int b, int c, int d, int e)
-{
- if ((b & 0x1111) != 1)
- f1 (a, b, c, d, e);
- return 0;
-}
-
-int
-main (void)
-{
- f2 (123, 0, 0, 0, 0);
- if (j != 123)
- abort ();
- return 0;
-}
-
+++ /dev/null
-/* { dg-do assemble { target i?86-*-* x86_64-*-* } } */
-/* { dg-skip-if "" { "*-*-darwin*" } { "*" } { "" } } */
-/* { dg-options "-std=c99 -x assembler-with-cpp" } */
-
-#ifndef __ASSEMBLER__
-extern int func(void);
-#else
-.global func
-.type func,%function
-.align 4
-func:
- ret
-.size func,.-func
-#endif
+++ /dev/null
-/* { dg-do compile { target i?86-*-* } } */
-/* { dg-require-effective-target ilp32 } */
-/* { dg-options "-O1 -ftree-vectorize -march=pentium4 -std=c99" } */
-
-void matmul_i4 (int bbase_yn, int xcount)
-{
- int x;
- int * restrict dest_y;
- const int * abase_n;
-
- for (x = 0; x < xcount; x++)
- {
- dest_y[x] += abase_n[x] * bbase_yn;
- }
-}
+++ /dev/null
-/* { dg-do compile { target i?86-*-* x86_64-*-* } } */
-/* { dg-options "-O2 -msse2 -ftree-vectorize -funswitch-loops" } */
-
-static int ready[10];
-void abort (void);
-void test_once (int t,int t1)
-{
- int i, repeat;
- for (i = 0; i < 10; i++)
- {
- ready[i] = 0;
- if (t1)
- if (b())
- abort ();
- }
- if (t)
- abort ();
-}
+++ /dev/null
-/* { dg-do compile { target { { i?86-*-* x86_64-*-* } && lp64 } } } */
-/* { dg-options "-std=c99" } */
-
-typedef _Complex float __attribute__((mode(TC))) _Complex128;
-
-_Complex128 foo (_Complex128 x, _Complex128 y)
-{
- return x * y;
-}
--- /dev/null
+/* { dg-do run { target *-*-linux* } } */
+/* { dg-require-effective-target ilp32 } */
+/* { dg-options "-O2 -fomit-frame-pointer" } */
+
+extern void abort (void);
+extern void exit (int);
+
+struct s {
+ struct { int a; } a;
+ int b;
+ struct { struct { int a; } a; struct t { struct t *a, *b; } b; } c;
+};
+
+int bar(int (*fn)(void *), void *arg, unsigned long flags)
+{
+ return 0;
+}
+
+int baz(void *x)
+{
+ return 0;
+}
+
+void do_check (struct s *) asm ("do_check") __attribute__((regparm(1)));
+
+void __attribute__((regparm(1))) do_check(struct s *x)
+{
+ if (x->a.a || x->b || x->c.a.a)
+ abort();
+ if (x->c.b.a != &x->c.b || x->c.b.b != &x->c.b)
+ abort();
+}
+
+#define NT "\n\t"
+
+asm ("\n"
+"___checkme:"
+NT "pushl %eax; pushl %ebx; pushl %ecx; pushl %edx; pushl %esi; pushl %edi"
+
+NT "pushl $0; pushl $0; pushl $0; pushl $0; pushl $0"
+NT "pushl $0; pushl $0; pushl $0; pushl $0; pushl $0"
+
+NT "movl %ecx, %eax"
+NT "call do_check"
+
+NT "popl %eax; popl %eax; popl %eax; popl %eax; popl %eax"
+NT "popl %eax; popl %eax; popl %eax; popl %eax; popl %eax"
+
+NT "popl %edi; popl %esi; popl %edx; popl %ecx; popl %ebx; popl %eax"
+NT "ret"
+);
+
+extern inline void do_asm(struct s * x)
+{
+ asm volatile("call ___checkme" : : "c" (x) : "memory");
+}
+
+int foo(void)
+{
+ struct s x = { { 0 }, 0, { { 0 }, { &x.c.b, &x.c.b } } };
+ bar(baz, &x, 1);
+ do_asm(&x);
+ bar(baz, &x, 1);
+ do_asm(&x);
+ return 0;
+}
+
+int main()
+{
+ foo();
+ exit(0);
+}
--- /dev/null
+/* { dg-do link } */
+/* { dg-require-effective-target ilp32 } */
+/* { dg-options "-O2 -march=pentiumpro" } */
+
+extern __inline double
+__expm1 (double __x)
+{
+ double __temp;
+ __temp = 1.0;
+ return __temp;
+}
+extern __inline double
+__sgn1 (double __x)
+{
+ return __x >= 0.0 ? 1.0 : -1.0;
+}
+double
+tanh (double __x)
+{
+ return __expm1 (__x) * __sgn1 (-__x);
+}
+main ()
+{
+ return tanh (3.45) != 0;
+}
--- /dev/null
+/* { dg-do link } */
+/* { dg-require-effective-target ilp32 } */
+/* { dg-options "-O2 -march=pentiumpro" } */
+
+extern __inline double
+__expm1 (double __x)
+{
+ double __temp;
+ __temp -= 1.0;
+ return __temp;
+}
+extern __inline double
+__sgn1 (double __x)
+{
+ return __x >= 0.0 ? 1.0 : -1.0;
+}
+double
+tanh (double __x)
+{
+ register double __exm1 = __expm1 (__x);
+ return __exm1 / (__exm1 + 2.0) * __sgn1 (-__x);
+}
+main ()
+{
+ return tanh (3.45) != 0;
+}
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-Wclobbered" } */
+
+int newsetjmp(void) __attribute__((returns_twice));
+void g(int);
+
+int
+main (void)
+{
+ register int reg asm ("esi") = 1; /* { dg-warning "might be clobbered" "" } */
+
+ if (!newsetjmp ())
+ {
+ reg = 2;
+ g (reg);
+ }
+ else
+ {
+ g (reg);
+ }
+
+ return 0;
+}
--- /dev/null
+/* Test if we inline memcpy even with -Os, when the user requested it. */
+/* Don't name this test with memcpy in its name, otherwise the scan-assembler
+ would be confused. */
+/* { dg-do compile { target *-*-linux* } } */
+/* { dg-options "-Os -minline-all-stringops" } */
+/* { dg-final { scan-assembler-not "memcpy" } } */
+char f(int i)
+{
+ char *ram_split[] = { "5:3", "3:1", "1:1", "3:5" };
+ return ram_split[i][0];
+}
--- /dev/null
+/* { dg-do run } */
+/* { dg-require-effective-target ilp32 } */
+/* { dg-options "-march=i386 -O3 -fomit-frame-pointer" } */
+
+/* For this test case, we used to do an invalid load motion after
+ reload, because we missed autoincrements of the stack pointer. */
+
+extern void abort (void);
+
+static int j;
+
+static void __attribute__((noinline))
+f1 (int a, int b, int c, int d, int e)
+{
+ j = a;
+}
+
+int __attribute__((noinline))
+f2 (int a, int b, int c, int d, int e)
+{
+ if ((b & 0x1111) != 1)
+ f1 (a, b, c, d, e);
+ return 0;
+}
+
+int
+main (void)
+{
+ f2 (123, 0, 0, 0, 0);
+ if (j != 123)
+ abort ();
+ return 0;
+}
+
--- /dev/null
+/* { dg-do assemble } */
+/* { dg-skip-if "" { "*-*-darwin*" } { "*" } { "" } } */
+/* { dg-options "-std=c99 -x assembler-with-cpp" } */
+
+#ifndef __ASSEMBLER__
+extern int func(void);
+#else
+.global func
+.type func,%function
+.align 4
+func:
+ ret
+.size func,.-func
+#endif
--- /dev/null
+/* { dg-do compile } */
+/* { dg-require-effective-target ilp32 } */
+/* { dg-options "-O1 -ftree-vectorize -march=pentium4 -std=c99" } */
+
+void matmul_i4 (int bbase_yn, int xcount)
+{
+ int x;
+ int * restrict dest_y;
+ const int * abase_n;
+
+ for (x = 0; x < xcount; x++)
+ {
+ dest_y[x] += abase_n[x] * bbase_yn;
+ }
+}
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O2 -msse2 -ftree-vectorize -funswitch-loops" } */
+
+static int ready[10];
+void abort (void);
+void test_once (int t,int t1)
+{
+ int i, repeat;
+ for (i = 0; i < 10; i++)
+ {
+ ready[i] = 0;
+ if (t1)
+ if (b())
+ abort ();
+ }
+ if (t)
+ abort ();
+}
-/* { dg-do compile { target dfp } } */
+/* { dg-do compile } */
+/* { dg-require-effective-target dfp } */
/* { dg-options "-O -std=gnu99" } */
_Decimal128 d128;
-/* { dg-do compile { target dfp } } */
+/* { dg-do compile } */
+/* { dg-require-effective-target dfp } */
/* { dg-options "-msse -std=gnu99" } */
_Decimal128 test (void)
-/* { dg-do run { target dfp } } */
+/* { dg-do run } */
+/* { dg-require-effective-target dfp } */
/* { dg-options "-Os -msse -std=gnu99" } */
extern void abort (void);
--- /dev/null
+/* { dg-do compile } */
+/* { dg-require-effective-target lp64 } */
+/* { dg-options "-std=c99" } */
+
+typedef _Complex float __attribute__((mode(TC))) _Complex128;
+
+_Complex128 foo (_Complex128 x, _Complex128 y)
+{
+ return x * y;
+}