Message ID | ydd8vxm3lyx.fsf@manam.CeBiTec.Uni-Bielefeld.DE |
---|---|
State | New |
Headers | show |
On Fri, Feb 11, 2011 at 11:27 AM, Rainer Orth <ro@cebitec.uni-bielefeld.de> wrote: > As reported in PR target/47629, the new gcc.target/i386/pr47312.c > testcase FAILs on i386-pc-solaris2.9: > > FAIL: gcc.target/i386/pr47312.c (test for excess errors) > Excess errors: > Undefined first referenced > symbol in file > fma /var/tmp//cckpBC57.o > fmaf /var/tmp//cckpBC57.o > fmal /var/tmp//cckpBC57.o > ld: fatal: Symbol referencing errors. No output written to pr47312.exe > > Those symbols are only present in C99, so the testcase should declare > this requirement. The following patch does this. Since some targets > need -std=c99 to activate the C99 runtime, asm needs to be replaced by > __asm__. > > Tested with the appropriate runtest invocations on i386-pc-solaris2.9 > (where the test is skipped as expected) and i386-pc-solaris2.10 (which > has a C99 runtime, where the test passes with -std=c99 added to the > other options). > > Ok for mainline? Ok. Thanks, Richard. > Rainer > > > 2011-02-11 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> > > PR target/47629 > * gcc.target/i386/pr47312.c: Use dg-require-effective-target > c99_runtime, dg-add-options c99_runtime. > (main): Use __asm__. > > Index: pr47312.c > =================================================================== > --- pr47312.c (revision 170046) > +++ pr47312.c (working copy) > @@ -2,7 +2,9 @@ > /* { dg-do link } */ > /* { dg-require-effective-target lto } */ > /* { dg-require-effective-target xop } */ > +/* { dg-require-effective-target c99_runtime } */ > /* { dg-options "-O -flto -mno-sse3 -mxop" } */ > +/* { dg-add-options c99_runtime } */ > > extern double fma (double, double, double); > extern float fmaf (float, float, float); > @@ -18,6 +20,6 @@ > f = fmaf (f, f, f); > d = fma (d, d, d); > ld = fmal (ld, ld, ld); > - asm volatile ("" : : "r" (&f), "r" (&d), "r" (&ld) : "memory"); > + __asm__ volatile ("" : : "r" (&f), "r" (&d), "r" (&ld) : "memory"); > return 0; > } > > > -- > ----------------------------------------------------------------------------- > Rainer Orth, Center for Biotechnology, Bielefeld University >
Index: pr47312.c =================================================================== --- pr47312.c (revision 170046) +++ pr47312.c (working copy) @@ -2,7 +2,9 @@ /* { dg-do link } */ /* { dg-require-effective-target lto } */ /* { dg-require-effective-target xop } */ +/* { dg-require-effective-target c99_runtime } */ /* { dg-options "-O -flto -mno-sse3 -mxop" } */ +/* { dg-add-options c99_runtime } */ extern double fma (double, double, double); extern float fmaf (float, float, float); @@ -18,6 +20,6 @@ f = fmaf (f, f, f); d = fma (d, d, d); ld = fmal (ld, ld, ld); - asm volatile ("" : : "r" (&f), "r" (&d), "r" (&ld) : "memory"); + __asm__ volatile ("" : : "r" (&f), "r" (&d), "r" (&ld) : "memory"); return 0; }