diff mbox

[PR63661] Add a test case for trunk.

Message ID 54775239.1040107@arm.com
State New
Headers show

Commit Message

Renlin Li Nov. 27, 2014, 4:32 p.m. UTC
Hi all,

PR63661 is effectively fixed by my previous patch here: 
https://gcc.gnu.org/ml/gcc-patches/2014-11/msg02253.html

This patch add a test case for it.

Okay for trunk?

gcc/testsuite/ChangeLog:

2014-11-27  Renlin Li  <Renlin.Li@arm.com>

      PR target/63661
     * gcc.target/i386/pr63661.c: New.

Comments

Richard Biener Nov. 28, 2014, 9:20 a.m. UTC | #1
On Thu, Nov 27, 2014 at 5:32 PM, Renlin Li <renlin.li@arm.com> wrote:
> Hi all,
>
> PR63661 is effectively fixed by my previous patch here:
> https://gcc.gnu.org/ml/gcc-patches/2014-11/msg02253.html
>
> This patch add a test case for it.
>
> Okay for trunk?

Ok.

Thanks,
RIchard.

> gcc/testsuite/ChangeLog:
>
> 2014-11-27  Renlin Li  <Renlin.Li@arm.com>
>
>      PR target/63661
>     * gcc.target/i386/pr63661.c: New.
Renlin Li Nov. 28, 2014, 11:23 a.m. UTC | #2
On 28/11/14 09:20, Richard Biener wrote:
> On Thu, Nov 27, 2014 at 5:32 PM, Renlin Li <renlin.li@arm.com> wrote:
>> Hi all,
>>
>> PR63661 is effectively fixed by my previous patch here:
>> https://gcc.gnu.org/ml/gcc-patches/2014-11/msg02253.html
>>
>> This patch add a test case for it.
>>
>> Okay for trunk?
> Ok.
>
> Thanks,
> RIchard.
>
>> gcc/testsuite/ChangeLog:
>>
>> 2014-11-27  Renlin Li  <Renlin.Li@arm.com>
>>
>>       PR target/63661
>>      * gcc.target/i386/pr63661.c: New.
Committed with minor change.

Use native tune. nehalem is not able to trigger the issue in trunk any more.

Sorry for the noise.

Regards,
Renlin
diff mbox

Patch

diff --git a/gcc/testsuite/gcc.target/i386/pr63661.c b/gcc/testsuite/gcc.target/i386/pr63661.c
new file mode 100644
index 0000000..8b55146
--- /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;
+}