Patchwork Another ldist testcase

login
register
mail settings
Submitter Jakub Jelinek
Date April 8, 2013, 8:31 a.m.
Message ID <20130408083110.GN20334@tucnak.redhat.com>
Download mbox | patch
Permalink /patch/234598/
State New
Headers show

Comments

Jakub Jelinek - April 8, 2013, 8:31 a.m.
Hi!

I was curious whether we don't miscompile the following testcase on 4.8
branch (-1+0i matches integer_all_onesp), but apparently we don't, because
TYPE_PRECISION on the COMPLEX_TYPE is 0.  Anyway, I'd like to check this
into trunk/4.8 branch, ok?

2013-04-08  Jakub Jelinek  <jakub@redhat.com>

	* gcc.c-torture/execute/pr56837.c: New test.


	Jakub
Richard Guenther - April 8, 2013, 8:43 a.m.
On Mon, 8 Apr 2013, Jakub Jelinek wrote:

> Hi!
> 
> I was curious whether we don't miscompile the following testcase on 4.8
> branch (-1+0i matches integer_all_onesp), but apparently we don't, because
> TYPE_PRECISION on the COMPLEX_TYPE is 0.  Anyway, I'd like to check this
> into trunk/4.8 branch, ok?

Ok.

Thanks,
Richard.

> 2013-04-08  Jakub Jelinek  <jakub@redhat.com>
> 
> 	* gcc.c-torture/execute/pr56837.c: New test.
> 
> --- gcc/testsuite/gcc.c-torture/execute/pr56837.c.jj	2013-02-13 21:50:57.150673158 +0100
> +++ gcc/testsuite/gcc.c-torture/execute/pr56837.c	2013-04-08 10:23:44.941870778 +0200
> @@ -0,0 +1,21 @@
> +extern void abort (void);
> +_Complex int a[1024];
> +
> +__attribute__((noinline, noclone)) void
> +foo (void)
> +{
> +  int i;
> +  for (i = 0; i < 1024; i++)
> +    a[i] = -1;
> +}
> +
> +int
> +main ()
> +{
> +  int i;
> +  foo ();
> +  for (i = 0; i < 1024; i++)
> +    if (a[i] != -1)
> +      abort ();
> +  return 0;
> +}
> 
> 	Jakub
> 
>

Patch

--- gcc/testsuite/gcc.c-torture/execute/pr56837.c.jj	2013-02-13 21:50:57.150673158 +0100
+++ gcc/testsuite/gcc.c-torture/execute/pr56837.c	2013-04-08 10:23:44.941870778 +0200
@@ -0,0 +1,21 @@ 
+extern void abort (void);
+_Complex int a[1024];
+
+__attribute__((noinline, noclone)) void
+foo (void)
+{
+  int i;
+  for (i = 0; i < 1024; i++)
+    a[i] = -1;
+}
+
+int
+main ()
+{
+  int i;
+  foo ();
+  for (i = 0; i < 1024; i++)
+    if (a[i] != -1)
+      abort ();
+  return 0;
+}