diff mbox

[RFC] Tweak gcc.c-torture/execute/pr39228.c

Message ID 20140903.094249.32448804.kkojima@rr.iij4u.or.jp
State New
Headers show

Commit Message

Kaz Kojima Sept. 3, 2014, 12:42 a.m. UTC
Hi,

gcc.c-torture/execute/pr39228.c fails with "(test for excess errors)"
on SH for recent revisions.  My gcc.log says:

gcc.c-torture/execute/pr39228.c:20:43: warning: always_inline function might not be inlinable [-Wattributes]
...

It looks that alpha has the similar issue:
https://gcc.gnu.org/ml/gcc-testresults/2014-08/msg02660.html

alpha and sh redefine dg-options to "-mieee" in the test case
instead of the default dg-options "-w" and get the above warning.
The patch below tweaks the test to fix it.  Perhaps the first
two lines are enough to avoid the error but avoiding the root cause
of warnings would be better.  Tested on i686-linux and sh4-linux.

Regards,
	kaz
--
	* gcc.c-torture/execute/pr39228.c: Add -w option on sh*-*-*
	and alhpa*-*-*.  Add "inline" keyword to test functions.

Comments

Oleg Endo Sept. 3, 2014, 4:41 a.m. UTC | #1
Hi,

On Sep 3, 2014, at 2:42 AM, Kaz Kojima <kkojima@rr.iij4u.or.jp> wrote:

> Hi,
> 
> gcc.c-torture/execute/pr39228.c fails with "(test for excess errors)"
> on SH for recent revisions.  My gcc.log says:
> 
> gcc.c-torture/execute/pr39228.c:20:43: warning: always_inline function might not be inlinable [-Wattributes]
> ...
> 
> It looks that alpha has the similar issue:
> https://gcc.gnu.org/ml/gcc-testresults/2014-08/msg02660.html
> 
> alpha and sh redefine dg-options to "-mieee" in the test case
> instead of the default dg-options "-w" and get the above warning.
> The patch below tweaks the test to fix it.  Perhaps the first
> two lines are enough to avoid the error but avoiding the root cause
> of warnings would be better.  Tested on i686-linux and sh4-linux.

-mieee should be the default on sh* and thus can be removed from the dg-options line, or is it not?  If -mieee is still needed (for alpha) maybe it's better to use dg-additional-options instead?

Cheers,
Oleg



> Regards,
>    kaz
> --
>    * gcc.c-torture/execute/pr39228.c: Add -w option on sh*-*-*
>    and alhpa*-*-*.  Add "inline" keyword to test functions.
> 
> --- ORIG/trunk/gcc/testsuite/gcc.c-torture/execute/pr39228.c    2014-08-26 09:26:20.000000000 +0900
> +++ trunk/gcc/testsuite/gcc.c-torture/execute/pr39228.c    2014-09-03 07:42:30.085524983 +0900
> @@ -1,23 +1,23 @@
> -/* { dg-options "-mieee" { target sh*-*-* alpha*-*-* } } */
> +/* { dg-options "-w -mieee" { target sh*-*-* alpha*-*-* } } */
> /* { dg-skip-if "No Inf/NaN support" { spu-*-* } "*" "" } */
> 
> extern void abort (void);
> 
> -static int __attribute__((always_inline)) testf (float b)
> +static inline int __attribute__((always_inline)) testf (float b)
> {
>   float c = 1.01f * b;
> 
>   return __builtin_isinff (c);
> }
> 
> -static int __attribute__((always_inline)) test (double b)
> +static inline int __attribute__((always_inline)) test (double b)
> {
>   double c = 1.01 * b;
> 
>   return __builtin_isinf (c);
> }
> 
> -static int __attribute__((always_inline)) testl (long double b)
> +static inline int __attribute__((always_inline)) testl (long double b)
> {
>   long double c = 1.01L * b;
>
diff mbox

Patch

--- ORIG/trunk/gcc/testsuite/gcc.c-torture/execute/pr39228.c	2014-08-26 09:26:20.000000000 +0900
+++ trunk/gcc/testsuite/gcc.c-torture/execute/pr39228.c	2014-09-03 07:42:30.085524983 +0900
@@ -1,23 +1,23 @@ 
-/* { dg-options "-mieee" { target sh*-*-* alpha*-*-* } } */
+/* { dg-options "-w -mieee" { target sh*-*-* alpha*-*-* } } */
 /* { dg-skip-if "No Inf/NaN support" { spu-*-* } "*" "" } */
 
 extern void abort (void);
 
-static int __attribute__((always_inline)) testf (float b)
+static inline int __attribute__((always_inline)) testf (float b)
 {
   float c = 1.01f * b;
 
   return __builtin_isinff (c);
 }
 
-static int __attribute__((always_inline)) test (double b)
+static inline int __attribute__((always_inline)) test (double b)
 {
   double c = 1.01 * b;
 
   return __builtin_isinf (c);
 }
 
-static int __attribute__((always_inline)) testl (long double b)
+static inline int __attribute__((always_inline)) testl (long double b)
 {
   long double c = 1.01L * b;