diff mbox

Inline across -ffast-math boundary

Message ID yddinyslgr6.fsf@CeBiTec.Uni-Bielefeld.DE
State New
Headers show

Commit Message

Rainer Orth May 5, 2016, 2:30 p.m. UTC
Richard Biener <rguenther@suse.de> writes:

>> >> This new testcase does not pass on bare-metal configs (using newlib),
>> >> because:
>> >> warning: implicit declaration of function 'isnanf'
>> >> [-Wimplicit-function-declaration]
>> >> warning: incompatible implicit declaration of built-in function 'isnanf'
>> >>
>> >> I'm not sure what's the appropriate dg-require to avoid this?
>> >
>> > c99_runtime I guess.
>> >
>> Indeed, that what was used in a previous occurrence of a similar
>> problem (PR 69227).
>> 
>> I've attached the small (obvious?) patch to make the new inline-8.c
>> test UNSUPPORTED
>> without c99_runtime.
>> 
>> OK?
>
> Ok.

The testcase still FAILs on Solaris:

FAIL: gcc.dg/ipa/inline-8.c (test for excess errors)
Excess errors:
/vol/gcc/src/hg/trunk/local/gcc/testsuite/gcc.dg/ipa/inline-8.c:12:10: warning: implicit declaration of function 'isnanf' [-Wimplicit-function-declaration]

The isnanf(3C) manpage claims that isnanf() is declared in <ieeefp.h>
(which is true), but the prototype is also in <math.h> under
__EXTENSIONS__ && !_XOPEN_SOURCE.

The function is not in C99 or XPG7, and instead of trying to do the
equivalent of AC_USE_SYSTEM_EXTENSIONS, I've followed the lead of
gcc.target/arm/pr59896.c and just declare it in the testcase.

Tested with the appropriate runtest invocations on i386-pc-solaris2.12
and x86_64-pc-linux-gnu, installed on mainline.

	Rainer


2016-05-04  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	* gcc.dg/ipa/inline-8.c	(isnanf): Declare.
diff mbox

Patch

# HG changeset patch
# Parent  7654b342bb270f12f16abf76b78e235c2798832f
Declare isnanf in gcc.dg/ipa/inline-8.c

diff --git a/gcc/testsuite/gcc.dg/ipa/inline-8.c b/gcc/testsuite/gcc.dg/ipa/inline-8.c
--- a/gcc/testsuite/gcc.dg/ipa/inline-8.c
+++ b/gcc/testsuite/gcc.dg/ipa/inline-8.c
@@ -5,6 +5,7 @@ 
 /* { dg-options "-O2"  } */
 /* { dg-add-options c99_runtime } */
 #include <math.h>
+extern int isnanf (float);
 /* Can't be inlined because isnanf will be optimized out.  */
 int
 cmp (float a)