public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: [RFC] Tweak gcc.c-torture/execute/pr39228.c
@ 2014-09-03  6:01 Uros Bizjak
  2014-09-03  6:28 ` Kaz Kojima
  0 siblings, 1 reply; 9+ messages in thread
From: Uros Bizjak @ 2014-09-03  6:01 UTC (permalink / raw)
  To: gcc-patches; +Cc: Kaz Kojima

Hello!

> 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.

--- 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-*-* } "*" "" } */

Please use /* { dg-add-options ieee } */ directive here. There is
another one possible in pr44683.c.

Uros.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [RFC] Tweak gcc.c-torture/execute/pr39228.c
  2014-09-03  6:01 [RFC] Tweak gcc.c-torture/execute/pr39228.c Uros Bizjak
@ 2014-09-03  6:28 ` Kaz Kojima
  2014-09-03 10:40   ` Richard Biener
  0 siblings, 1 reply; 9+ messages in thread
From: Kaz Kojima @ 2014-09-03  6:28 UTC (permalink / raw)
  To: ubizjak; +Cc: gcc-patches

Uros Bizjak <ubizjak@gmail.com> wrote:
> -/* { dg-options "-mieee" { target sh*-*-* alpha*-*-* } } */
> +/* { dg-options "-w -mieee" { target sh*-*-* alpha*-*-* } } */
>  /* { dg-skip-if "No Inf/NaN support" { spu-*-* } "*" "" } */
> 
> Please use /* { dg-add-options ieee } */ directive here. There is
> another one possible in pr44683.c.

Thanks for your suggestion.  Here is a take 3 patch.
I'll take a look at pr44683.c.

Regards,
	kaz
--
	* gcc.c-torture/execute/pr39228.c: Use dg-add-options instead
	of dg-options.  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 15:23:15.219917354 +0900
@@ -1,23 +1,23 @@
-/* { dg-options "-mieee" { target sh*-*-* alpha*-*-* } } */
+/* { dg-add-options ieee } */
 /* { 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;
 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [RFC] Tweak gcc.c-torture/execute/pr39228.c
  2014-09-03  6:28 ` Kaz Kojima
@ 2014-09-03 10:40   ` Richard Biener
  0 siblings, 0 replies; 9+ messages in thread
From: Richard Biener @ 2014-09-03 10:40 UTC (permalink / raw)
  To: Kaz Kojima; +Cc: Uros Bizjak, GCC Patches

On Wed, Sep 3, 2014 at 8:28 AM, Kaz Kojima <kkojima@rr.iij4u.or.jp> wrote:
> Uros Bizjak <ubizjak@gmail.com> wrote:
>> -/* { dg-options "-mieee" { target sh*-*-* alpha*-*-* } } */
>> +/* { dg-options "-w -mieee" { target sh*-*-* alpha*-*-* } } */
>>  /* { dg-skip-if "No Inf/NaN support" { spu-*-* } "*" "" } */
>>
>> Please use /* { dg-add-options ieee } */ directive here. There is
>> another one possible in pr44683.c.
>
> Thanks for your suggestion.  Here is a take 3 patch.
> I'll take a look at pr44683.c.

Ok.

Thanks,
Richard.

> Regards,
>         kaz
> --
>         * gcc.c-torture/execute/pr39228.c: Use dg-add-options instead
>         of dg-options.  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 15:23:15.219917354 +0900
> @@ -1,23 +1,23 @@
> -/* { dg-options "-mieee" { target sh*-*-* alpha*-*-* } } */
> +/* { dg-add-options ieee } */
>  /* { 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;
>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [RFC] Tweak gcc.c-torture/execute/pr39228.c
  2014-09-04  0:22       ` Kaz Kojima
@ 2014-09-05  4:39         ` Jeff Law
  0 siblings, 0 replies; 9+ messages in thread
From: Jeff Law @ 2014-09-05  4:39 UTC (permalink / raw)
  To: Kaz Kojima; +Cc: oleg.endo, gcc-patches

On 09/03/14 18:22, Kaz Kojima wrote:
> Jeff Law <law@redhat.com> wrote:
>>> 	* gcc.c-torture/execute/pr39228.c: Use dg-additional-options
>>> 	instead of dg-options and remove sh*-*-* from its target list.
>>> 	Add "inline" keyword to test functions.
>> Wouldn't we be better off moving this into execute/ieee?
>
> I've tried it and found that all execute/ieee tests are compiled
> with -fno-inline.  Perhaps it's a reason for not having moved
> that test into there, though I could be wrong about that.
More likely nobody even pondered it.  I'm not going to object to just 
tweaking the test in-place, but just wanted to throw out a suggestion 
that might be worth investigation.

jeff

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [RFC] Tweak gcc.c-torture/execute/pr39228.c
  2014-09-03 19:03     ` Jeff Law
@ 2014-09-04  0:22       ` Kaz Kojima
  2014-09-05  4:39         ` Jeff Law
  0 siblings, 1 reply; 9+ messages in thread
From: Kaz Kojima @ 2014-09-04  0:22 UTC (permalink / raw)
  To: law; +Cc: oleg.endo, gcc-patches

Jeff Law <law@redhat.com> wrote:
>> 	* gcc.c-torture/execute/pr39228.c: Use dg-additional-options
>> 	instead of dg-options and remove sh*-*-* from its target list.
>> 	Add "inline" keyword to test functions.
> Wouldn't we be better off moving this into execute/ieee?

I've tried it and found that all execute/ieee tests are compiled
with -fno-inline.  Perhaps it's a reason for not having moved
that test into there, though I could be wrong about that.

Regards,
	kaz

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [RFC] Tweak gcc.c-torture/execute/pr39228.c
  2014-09-03  5:26   ` Kaz Kojima
@ 2014-09-03 19:03     ` Jeff Law
  2014-09-04  0:22       ` Kaz Kojima
  0 siblings, 1 reply; 9+ messages in thread
From: Jeff Law @ 2014-09-03 19:03 UTC (permalink / raw)
  To: Kaz Kojima, oleg.endo; +Cc: gcc-patches

On 09/02/14 23:26, Kaz Kojima wrote:
> Oleg Endo <oleg.endo@t-online.de> wrote:
>> -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?
>
> Sure.  The attached is a revised one.
>
> Regards,
> 	kaz
> --
> 	* gcc.c-torture/execute/pr39228.c: Use dg-additional-options
> 	instead of dg-options and remove sh*-*-* from its target list.
> 	Add "inline" keyword to test functions.
Wouldn't we be better off moving this into execute/ieee?

jeff

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [RFC] Tweak gcc.c-torture/execute/pr39228.c
  2014-09-03  4:41 ` Oleg Endo
@ 2014-09-03  5:26   ` Kaz Kojima
  2014-09-03 19:03     ` Jeff Law
  0 siblings, 1 reply; 9+ messages in thread
From: Kaz Kojima @ 2014-09-03  5:26 UTC (permalink / raw)
  To: oleg.endo; +Cc: gcc-patches

Oleg Endo <oleg.endo@t-online.de> wrote:
> -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?

Sure.  The attached is a revised one.

Regards,
	kaz
--
	* gcc.c-torture/execute/pr39228.c: Use dg-additional-options
	instead of dg-options and remove sh*-*-* from its target list.
	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 14:16:23.313631715 +0900
@@ -1,23 +1,23 @@
-/* { dg-options "-mieee" { target sh*-*-* alpha*-*-* } } */
+/* { dg-additional-options "-mieee" { target 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;
 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [RFC] Tweak gcc.c-torture/execute/pr39228.c
  2014-09-03  0:43 Kaz Kojima
@ 2014-09-03  4:41 ` Oleg Endo
  2014-09-03  5:26   ` Kaz Kojima
  0 siblings, 1 reply; 9+ messages in thread
From: Oleg Endo @ 2014-09-03  4:41 UTC (permalink / raw)
  To: Kaz Kojima; +Cc: gcc-patches

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;
> 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [RFC] Tweak gcc.c-torture/execute/pr39228.c
@ 2014-09-03  0:43 Kaz Kojima
  2014-09-03  4:41 ` Oleg Endo
  0 siblings, 1 reply; 9+ messages in thread
From: Kaz Kojima @ 2014-09-03  0:43 UTC (permalink / raw)
  To: gcc-patches

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.

--- 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;
 

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2014-09-05  4:39 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-03  6:01 [RFC] Tweak gcc.c-torture/execute/pr39228.c Uros Bizjak
2014-09-03  6:28 ` Kaz Kojima
2014-09-03 10:40   ` Richard Biener
  -- strict thread matches above, loose matches on Subject: below --
2014-09-03  0:43 Kaz Kojima
2014-09-03  4:41 ` Oleg Endo
2014-09-03  5:26   ` Kaz Kojima
2014-09-03 19:03     ` Jeff Law
2014-09-04  0:22       ` Kaz Kojima
2014-09-05  4:39         ` Jeff Law

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).