[libffi testsuite] Set -ffp-contract=off for libffi.call/many.c

James Greenhalgh james.greenhalgh@arm.com
Thu May 9 12:59:00 GMT 2013


*ping^2*

(Can we still submit patches via this list, or does there need to
be a pull request?)

Thanks,
James

> -----Original Message-----
> From: James Greenhalgh
> Sent: 19 April 2013 11:02
> To: James Greenhalgh; libffi-discuss@sourceware.org
> Cc: 'Anthony Green'
> Subject: RE: [libffi testsuite] Set -ffp-contract=off for
> libffi.call/many.c
> 
> *ping*
> 
> > -----Original Message-----
> > From: James Greenhalgh
> > Sent: 08 April 2013 10:37
> > To: libffi-discuss@sourceware.org
> > Subject: [libffi testsuite] Set -ffp-contract=off for
> > libffi.call/many.c
> >
> >
> > Hi,
> >
> > A recent patch fixed libffi.call/many.c to check that the absolute
> > value of the difference of its two test results was smaller than
> > FLT_EPSILON,
> > rather than just checking their difference.
> >
> > Sadly, this exposes a problem with the testcase for targets with
> > a fused-multiply-add instruction. After inlining the non-ffi function
> > body, GCC will happily contract the final multiply with the subtract
> > for the comparison. Thus skipping the rounding step after the
> multiply
> > and causing an error large enough to cause the test to fail.
> >
> > Fixed by adding -ffp-contract=off to the list of dg-options thus
> > suppressing the introduction of fused-multiply-add.
> >
> > Tested on aarch64-none-linux-gnu to ensure the failure becomes
> > a pass.
> >
> > Thanks,
> > James Greenhalgh
> >
> > ---
> >
> > 2013-04-08  James Greenhalgh  <james.greenhalgh@arm.com>
> >
> > 	* testsuite/libffi.call/many.c: Set -ffp-contract=off.
> 
> 
>
> diff --git a/testsuite/libffi.call/many.c b/testsuite/libffi.call/many.c
> index 67a367f..afade91 100644
> --- a/testsuite/libffi.call/many.c
> +++ b/testsuite/libffi.call/many.c
> @@ -5,6 +5,8 @@
>     Originator:	From the original ffitest.c  */
>  
>  /* { dg-do run } */
> +/* { dg-options -ffp-contract=off } */
> +
> #include "ffitest.h"
> 
> #include <stdlib.h>





More information about the Libffi-discuss mailing list