From: Renlin Li Date: Fri, 28 Nov 2014 11:01:27 +0000 (+0000) Subject: Add testcase for PR63661. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=244464039105a00244f078313c4cfb314ee729fa;p=gcc.git Add testcase for PR63661. 2014-11-28 Renlin Li PR target/63661 * gcc.target/i386/pr63661.c: New test. From-SVN: r218143 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 4bb39e1915b..3d2e2142191 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2014-11-27 Renlin Li + + PR target/63661 + * gcc.target/i386/pr63661.c: New test. + 2014-11-28 Marek Polacek PR c/63862 diff --git a/gcc/testsuite/gcc.target/i386/pr63661.c b/gcc/testsuite/gcc.target/i386/pr63661.c new file mode 100644 index 00000000000..8b55146c4f5 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr63661.c @@ -0,0 +1,77 @@ +/* PR target/63661 */ +/* { dg-do run } */ +/* { dg-require-effective-target fpic } */ +/* { dg-options "-mtune=nehalem -fPIC -O2" } */ + +static void __attribute__((noinline,noclone,hot)) +foo (double a, double q, double *ff, double *gx, int e, int ni) +{ + union + { + double n; + unsigned long long o; + } punner; + + punner.n = q; + __builtin_printf("B: 0x%016llx ---- %g\n", punner.o, q); + + if(q != 5) + __builtin_abort(); +} + +static int __attribute__((noinline,noclone,hot)) +bar (int order, double q, double c[]) +{ + int ni, nn, i, e; + double g2, x2, de, s, ratio, ff; + + nn = 0; + e = order & 1; + s = 0; + ratio = 0; + x2 = 0; + g2 = 0; + + if(q == 0.0) + return 0; + + if (order < 5) + { + ratio = 1.0 / q; + nn = order; + } + + ni = -nn; + + while(1) + { + de = ratio - g2 - x2; + + foo (0, q, &ff, &g2, e, ni); + + if((int)de == 0) + break; + } + + s += 2 * nn * c[nn]; + + for (i = 0; i < 1; i++) + { + c[0] = nn; + for (; i < 10; i++) + c[i] = 0.0; + c[0] /= s; + } + + return 0; +} + +int +main () +{ + double c[1000]; + + __builtin_printf("A: 0x%016llx\n", (unsigned long long)c); + bar (1, 5.0, c); + return 0; +}