Message ID | 20130408083110.GN20334@tucnak.redhat.com |
---|---|
State | New |
Headers | show |
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 > >
--- 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; +}