public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH, testsuite] Fix PR68629: attr-simd-3.c failure on arm-none-eabi targets
@ 2015-12-09  9:56 Thomas Preud'homme
  2015-12-10 21:50 ` Jeff Law
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Thomas Preud'homme @ 2015-12-09  9:56 UTC (permalink / raw)
  To: gcc-patches

c-c++-common/attr-simd-3.c fails to compile on arm-none-eabi targets due to -fcilkplus needing -pthread which is not available for those targets. This patch solves this issue by adding a condition to the cilkplus effective target that compiling with -fcilkplus succeeds and requires cilkplus as an effective target for attr-simd-3.c testcase.

ChangeLog entry is as follows:


*** gcc/testsuite/ChangeLog ***

2015-12-08  Thomas Preud'homme  <thomas.preudhomme@arm.com>

        PR testsuite/68629
        * lib/target-supports.exp (check_effective_target_cilkplus): Also
        check that compiling with -fcilkplus does not give an error.
        * c-c++-common/attr-simd-3.c: Require cilkplus effective target.


diff --git a/gcc/testsuite/c-c++-common/attr-simd-3.c b/gcc/testsuite/c-c++-common/attr-simd-3.c
index d61ba82..1970c67 100644
--- a/gcc/testsuite/c-c++-common/attr-simd-3.c
+++ b/gcc/testsuite/c-c++-common/attr-simd-3.c
@@ -1,4 +1,5 @@
 /* { dg-do compile } */
+/* { dg-require-effective-target "cilkplus" } */
 /* { dg-options "-fcilkplus" } */
 /* { dg-prune-output "undeclared here \\(not in a function\\)|\[^\n\r\]* was not declared in this scope" } */
 
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index 4e349e9..95b903c 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -1432,7 +1432,12 @@ proc check_effective_target_cilkplus { } {
     if { [istarget avr-*-*] } {
 	return 0;
     }
-    return 1
+    return [ check_no_compiler_messages_nocache fcilkplus_available executable {
+	#ifdef __cplusplus
+	extern "C"
+	#endif
+	    int dummy;
+	} "-fcilkplus" ]
 }
 
 proc check_linker_plugin_available { } {


Testsuite shows no regression when run with
  + an arm-none-eabi GCC cross-compiler targeting Cortex-M3
  + a bootstrapped x86_64-linux-gnu GCC native compiler

Is this ok for trunk?

Best regards,

Thomas


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

* Re: [PATCH, testsuite] Fix PR68629: attr-simd-3.c failure on arm-none-eabi targets
  2015-12-09  9:56 [PATCH, testsuite] Fix PR68629: attr-simd-3.c failure on arm-none-eabi targets Thomas Preud'homme
@ 2015-12-10 21:50 ` Jeff Law
  2015-12-15 16:45 ` Thomas Schwinge
  2015-12-17  8:44 ` Thomas Preud'homme
  2 siblings, 0 replies; 7+ messages in thread
From: Jeff Law @ 2015-12-10 21:50 UTC (permalink / raw)
  To: Thomas Preud'homme, gcc-patches

On 12/09/2015 02:56 AM, Thomas Preud'homme wrote:
> c-c++-common/attr-simd-3.c fails to compile on arm-none-eabi targets due to -fcilkplus needing -pthread which is not available for those targets. This patch solves this issue by adding a condition to the cilkplus effective target that compiling with -fcilkplus succeeds and requires cilkplus as an effective target for attr-simd-3.c testcase.
>
> ChangeLog entry is as follows:
>
>
> *** gcc/testsuite/ChangeLog ***
>
> 2015-12-08  Thomas Preud'homme  <thomas.preudhomme@arm.com>
>
>          PR testsuite/68629
>          * lib/target-supports.exp (check_effective_target_cilkplus): Also
>          check that compiling with -fcilkplus does not give an error.
>          * c-c++-common/attr-simd-3.c: Require cilkplus effective target.
OK.

Note however, that the simd attribute is now independent of Cilk+.  So 
generally we shouldn't want/need -fcilkplus for uses of that attribute. 
  This case is somewhat special in that we're checking for something 
that's considered a syntax error for Cilk+, so it probably makes sense 
to keep the test as-is.

I do wonder if a complementary test where we try to apply that attribute 
to a function (without the vector attribute) and compile without the 
-fcilkplus option would be wise.  We ought to be throwing some kind of 
error in that situation and it'd be useful to verify that's the case.

jeff

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

* Re: [PATCH, testsuite] Fix PR68629: attr-simd-3.c failure on arm-none-eabi targets
  2015-12-09  9:56 [PATCH, testsuite] Fix PR68629: attr-simd-3.c failure on arm-none-eabi targets Thomas Preud'homme
  2015-12-10 21:50 ` Jeff Law
@ 2015-12-15 16:45 ` Thomas Schwinge
  2015-12-17  8:03   ` Thomas Schwinge
  2015-12-17  8:44 ` Thomas Preud'homme
  2 siblings, 1 reply; 7+ messages in thread
From: Thomas Schwinge @ 2015-12-15 16:45 UTC (permalink / raw)
  To: Thomas Preud'homme; +Cc: Jeff Law, gcc-patches, Tobias Burnus, Rainer Orth

[-- Attachment #1: Type: text/plain, Size: 2407 bytes --]

Hi!

On Wed, 9 Dec 2015 17:56:13 +0800, "Thomas Preud'homme" <thomas.preudhomme@arm.com> wrote:
> c-c++-common/attr-simd-3.c fails to compile on arm-none-eabi targets due to -fcilkplus needing -pthread which is not available for those targets. This patch solves this issue by adding a condition to the cilkplus effective target that compiling with -fcilkplus succeeds and requires cilkplus as an effective target for attr-simd-3.c testcase.

>         PR testsuite/68629
>         * lib/target-supports.exp (check_effective_target_cilkplus): Also
>         check that compiling with -fcilkplus does not give an error.
>         * c-c++-common/attr-simd-3.c: Require cilkplus effective target.

> --- a/gcc/testsuite/lib/target-supports.exp
> +++ b/gcc/testsuite/lib/target-supports.exp
> @@ -1432,7 +1432,12 @@ proc check_effective_target_cilkplus { } {
>      if { [istarget avr-*-*] } {
>  	return 0;
>      }
> -    return 1
> +    return [ check_no_compiler_messages_nocache fcilkplus_available executable {
> +	#ifdef __cplusplus
> +	extern "C"
> +	#endif
> +	    int dummy;
> +	} "-fcilkplus" ]
>  }
>  
>  proc check_linker_plugin_available { } {
> 
> 
> Testsuite shows no regression when run with
>   + an arm-none-eabi GCC cross-compiler targeting Cortex-M3
>   + a bootstrapped x86_64-linux-gnu GCC native compiler

With this committed in r231605, I now see all gcc/testsuite/ Cilk+
testing disappear for "configure && make && make check", because of:

    Executing on host: [...]/build-gcc/gcc/xgcc -B[...]/build-gcc/gcc/ fcilkplus_available14337.c  -fno-diagnostics-show-caret -fdiagnostics-color=never  -fcilkplus  -lm    -o fcilkplus_available14337.exe    (timeout = 300)
    spawn [...]/build-gcc/gcc/xgcc -B[...]/build-gcc/gcc/ fcilkplus_available14337.c -fno-diagnostics-show-caret -fdiagnostics-color=never -fcilkplus -lm -o fcilkplus_available14337.exe
    xgcc: error: libcilkrts.spec: No such file or directory
    compiler exited with status 1

Can you confirm that in your build/test tree, the compiler is picking up
the build-tree libcilkrts, and not the one from /usr/lib/ (or similar)?

Long ago, in r208889, a similar problem has been diagnosed and fixed by
Rainer and Tobias (CCed just in case),
<http://news.gmane.org/find-root.php?message_id=%3C53336904.5010003%40net-b.de%3E>,
so I wonder what broke now?


Grüße
 Thomas

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 472 bytes --]

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

* Re: [PATCH, testsuite] Fix PR68629: attr-simd-3.c failure on arm-none-eabi targets
  2015-12-15 16:45 ` Thomas Schwinge
@ 2015-12-17  8:03   ` Thomas Schwinge
  2015-12-17  8:26     ` Jakub Jelinek
  0 siblings, 1 reply; 7+ messages in thread
From: Thomas Schwinge @ 2015-12-17  8:03 UTC (permalink / raw)
  To: Thomas Preud'homme; +Cc: Jeff Law, gcc-patches, Tobias Burnus, Rainer Orth

[-- Attachment #1: Type: text/plain, Size: 3342 bytes --]

Hi!

On Tue, 15 Dec 2015 17:44:59 +0100, I wrote:
> On Wed, 9 Dec 2015 17:56:13 +0800, "Thomas Preud'homme" <thomas.preudhomme@arm.com> wrote:
> > c-c++-common/attr-simd-3.c fails to compile on arm-none-eabi targets due to -fcilkplus needing -pthread which is not available for those targets. This patch solves this issue by adding a condition to the cilkplus effective target that compiling with -fcilkplus succeeds and requires cilkplus as an effective target for attr-simd-3.c testcase.
> 
> >         PR testsuite/68629
> >         * lib/target-supports.exp (check_effective_target_cilkplus): Also
> >         check that compiling with -fcilkplus does not give an error.
> >         * c-c++-common/attr-simd-3.c: Require cilkplus effective target.
> 
> > --- a/gcc/testsuite/lib/target-supports.exp
> > +++ b/gcc/testsuite/lib/target-supports.exp
> > @@ -1432,7 +1432,12 @@ proc check_effective_target_cilkplus { } {
> >      if { [istarget avr-*-*] } {
> >  	return 0;
> >      }
> > -    return 1
> > +    return [ check_no_compiler_messages_nocache fcilkplus_available executable {
> > +	#ifdef __cplusplus
> > +	extern "C"
> > +	#endif
> > +	    int dummy;
> > +	} "-fcilkplus" ]
> >  }
> >  
> >  proc check_linker_plugin_available { } {
> > 
> > 
> > Testsuite shows no regression when run with
> >   + an arm-none-eabi GCC cross-compiler targeting Cortex-M3
> >   + a bootstrapped x86_64-linux-gnu GCC native compiler
> 
> With this committed in r231605, I now see all gcc/testsuite/ Cilk+
> testing disappear for "configure && make && make check", because of:
> 
>     Executing on host: [...]/build-gcc/gcc/xgcc -B[...]/build-gcc/gcc/ fcilkplus_available14337.c  -fno-diagnostics-show-caret -fdiagnostics-color=never  -fcilkplus  -lm    -o fcilkplus_available14337.exe    (timeout = 300)
>     spawn [...]/build-gcc/gcc/xgcc -B[...]/build-gcc/gcc/ fcilkplus_available14337.c -fno-diagnostics-show-caret -fdiagnostics-color=never -fcilkplus -lm -o fcilkplus_available14337.exe
>     xgcc: error: libcilkrts.spec: No such file or directory
>     compiler exited with status 1

By the way, this also happens for c-c++-common/attr-simd-3.c, gcc.log,
for example:

    Executing on host: [...]/build-gcc/gcc/xgcc -B[...]/build-gcc/gcc/ 
    fcilkplus_available14668.c  -fno-diagnostics-show-caret -fdiagnostics-color=never  -fcilkplus  -lm    -o fcilkplus_available14668.exe    (timeout = 300)
    spawn [...]/build-gcc/gcc/xgcc -B[...]/build-gcc/gcc/ fcilkplus_available14668.c -fno-diagnostics-show-caret -fdiagnostics-color=never -fcilkplus -lm -o fcilkplus_available14668.exe
    xgcc: error: libcilkrts.spec: No such file or directory
    compiler exited with status 1
    output is:
    xgcc: error: libcilkrts.spec: No such file or directory
    
    UNSUPPORTED: c-c++-common/attr-simd-3.c  -Wc++-compat 

Can you confirm and are you going to resolve that?

> Can you confirm that in your build/test tree, the compiler is picking up
> the build-tree libcilkrts, and not the one from /usr/lib/ (or similar)?
> 
> Long ago, in r208889, a similar problem has been diagnosed and fixed by
> Rainer and Tobias (CCed just in case),
> <http://news.gmane.org/find-root.php?message_id=%3C53336904.5010003%40net-b.de%3E>,
> so I wonder what broke now?


Grüße
 Thomas

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 472 bytes --]

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

* Re: [PATCH, testsuite] Fix PR68629: attr-simd-3.c failure on arm-none-eabi targets
  2015-12-17  8:03   ` Thomas Schwinge
@ 2015-12-17  8:26     ` Jakub Jelinek
  2015-12-17  8:34       ` Thomas Preud'homme
  0 siblings, 1 reply; 7+ messages in thread
From: Jakub Jelinek @ 2015-12-17  8:26 UTC (permalink / raw)
  To: Thomas Schwinge
  Cc: Thomas Preud'homme, Jeff Law, gcc-patches, Tobias Burnus,
	Rainer Orth

On Thu, Dec 17, 2015 at 09:02:39AM +0100, Thomas Schwinge wrote:
> On Tue, 15 Dec 2015 17:44:59 +0100, I wrote:
> > On Wed, 9 Dec 2015 17:56:13 +0800, "Thomas Preud'homme" <thomas.preudhomme@arm.com> wrote:
> > > c-c++-common/attr-simd-3.c fails to compile on arm-none-eabi targets due to -fcilkplus needing -pthread which is not available for those targets. This patch solves this issue by adding a condition to the cilkplus effective target that compiling with -fcilkplus succeeds and requires cilkplus as an effective target for attr-simd-3.c testcase.
> > 
> > >         PR testsuite/68629
> > >         * lib/target-supports.exp (check_effective_target_cilkplus): Also
> > >         check that compiling with -fcilkplus does not give an error.
> > >         * c-c++-common/attr-simd-3.c: Require cilkplus effective target.
> > 
> > > --- a/gcc/testsuite/lib/target-supports.exp
> > > +++ b/gcc/testsuite/lib/target-supports.exp
> > > @@ -1432,7 +1432,12 @@ proc check_effective_target_cilkplus { } {
> > >      if { [istarget avr-*-*] } {
> > >  	return 0;
> > >      }
> > > -    return 1
> > > +    return [ check_no_compiler_messages_nocache fcilkplus_available executable {
> > > +	#ifdef __cplusplus
> > > +	extern "C"
> > > +	#endif
> > > +	    int dummy;
> > > +	} "-fcilkplus" ]
> > >  }

That change has been obviously bad.  If anything, you want to make it
compile time only, i.e. check_no_compiler_messages_nocache fcilkplus_available assembly
Just look at cilk-plus.exp:
It checks check_effective_target_cilkplus, and performs lots of tests if it
it returns true, and then checks check_libcilkrts_available and performs
further tests.
So, if any use of -fcilkplus fails on your target, then putting it
into check_effective_target_cilkplus is fine, you won't lose any Cilk+
testing that way.  Otherwise, if it is conditional say only some constructs,
say array notation is fine, but _Cilk_for is not, then even that is wrong.

In any case, IMHO the attr-simd-3.c test just should be moved into
c-c++-common/cilk-plus/SE/ directory.

	Jakub

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

* RE: [PATCH, testsuite] Fix PR68629: attr-simd-3.c failure on arm-none-eabi targets
  2015-12-17  8:26     ` Jakub Jelinek
@ 2015-12-17  8:34       ` Thomas Preud'homme
  0 siblings, 0 replies; 7+ messages in thread
From: Thomas Preud'homme @ 2015-12-17  8:34 UTC (permalink / raw)
  To: 'Jakub Jelinek', Thomas Schwinge
  Cc: Jeff Law, gcc-patches, Tobias Burnus, Rainer Orth

Hi,

> From: Jakub Jelinek [mailto:jakub@redhat.com]
> Sent: Thursday, December 17, 2015 4:26 PM
> > >
> > > > --- a/gcc/testsuite/lib/target-supports.exp
> > > > +++ b/gcc/testsuite/lib/target-supports.exp
> > > > @@ -1432,7 +1432,12 @@ proc check_effective_target_cilkplus { } {
> > > >      if { [istarget avr-*-*] } {
> > > >  	return 0;
> > > >      }
> > > > -    return 1
> > > > +    return [ check_no_compiler_messages_nocache
> fcilkplus_available executable {
> > > > +	#ifdef __cplusplus
> > > > +	extern "C"
> > > > +	#endif
> > > > +	    int dummy;
> > > > +	} "-fcilkplus" ]
> > > >  }
> 
> That change has been obviously bad.  If anything, you want to make it
> compile time only, i.e. check_no_compiler_messages_nocache
> fcilkplus_available assembly

Indeed, I failed to parse the space and didn't realize the kind of testing could be selected.

> Just look at cilk-plus.exp:
> It checks check_effective_target_cilkplus, and performs lots of tests if it
> it returns true, and then checks check_libcilkrts_available and performs
> further tests.
> So, if any use of -fcilkplus fails on your target, then putting it
> into check_effective_target_cilkplus is fine, you won't lose any Cilk+
> testing that way.  Otherwise, if it is conditional say only some constructs,
> say array notation is fine, but _Cilk_for is not, then even that is wrong.

Ok. When I saw the very small list of target for which the condition returned true, I thought the goal was only to check if the target *could* support cilkplus and that actual support was tested by cilk-plus.exp. I'll revert this commit and prepare a patch to add arm in that list.

> 
> In any case, IMHO the attr-simd-3.c test just should be moved into
> c-c++-common/cilk-plus/SE/ directory.

That was my thought initially but then I changed my mind, thinking that the test was placed there for a reason. I'll prepare a third patch to do that.

My apologize for the breakage.

Best regards,

Thomas


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

* RE: [PATCH, testsuite] Fix PR68629: attr-simd-3.c failure on arm-none-eabi targets
  2015-12-09  9:56 [PATCH, testsuite] Fix PR68629: attr-simd-3.c failure on arm-none-eabi targets Thomas Preud'homme
  2015-12-10 21:50 ` Jeff Law
  2015-12-15 16:45 ` Thomas Schwinge
@ 2015-12-17  8:44 ` Thomas Preud'homme
  2 siblings, 0 replies; 7+ messages in thread
From: Thomas Preud'homme @ 2015-12-17  8:44 UTC (permalink / raw)
  To: gcc-patches

Reverted now.

> -----Original Message-----
> From: gcc-patches-owner@gcc.gnu.org [mailto:gcc-patches-
> owner@gcc.gnu.org] On Behalf Of Thomas Preud'homme
> Sent: Wednesday, December 09, 2015 5:56 PM
> To: gcc-patches@gcc.gnu.org
> Subject: [PATCH, testsuite] Fix PR68629: attr-simd-3.c failure on arm-
> none-eabi targets
> 
> c-c++-common/attr-simd-3.c fails to compile on arm-none-eabi targets
> due to -fcilkplus needing -pthread which is not available for those targets.
> This patch solves this issue by adding a condition to the cilkplus effective
> target that compiling with -fcilkplus succeeds and requires cilkplus as an
> effective target for attr-simd-3.c testcase.
> 
> ChangeLog entry is as follows:
> 
> 
> *** gcc/testsuite/ChangeLog ***
> 
> 2015-12-08  Thomas Preud'homme  <thomas.preudhomme@arm.com>
> 
>         PR testsuite/68629
>         * lib/target-supports.exp (check_effective_target_cilkplus): Also
>         check that compiling with -fcilkplus does not give an error.
>         * c-c++-common/attr-simd-3.c: Require cilkplus effective target.
> 
> 
> diff --git a/gcc/testsuite/c-c++-common/attr-simd-3.c b/gcc/testsuite/c-
> c++-common/attr-simd-3.c
> index d61ba82..1970c67 100644
> --- a/gcc/testsuite/c-c++-common/attr-simd-3.c
> +++ b/gcc/testsuite/c-c++-common/attr-simd-3.c
> @@ -1,4 +1,5 @@
>  /* { dg-do compile } */
> +/* { dg-require-effective-target "cilkplus" } */
>  /* { dg-options "-fcilkplus" } */
>  /* { dg-prune-output "undeclared here \\(not in a
> function\\)|\[^\n\r\]* was not declared in this scope" } */
> 
> diff --git a/gcc/testsuite/lib/target-supports.exp
> b/gcc/testsuite/lib/target-supports.exp
> index 4e349e9..95b903c 100644
> --- a/gcc/testsuite/lib/target-supports.exp
> +++ b/gcc/testsuite/lib/target-supports.exp
> @@ -1432,7 +1432,12 @@ proc check_effective_target_cilkplus { } {
>      if { [istarget avr-*-*] } {
>  	return 0;
>      }
> -    return 1
> +    return [ check_no_compiler_messages_nocache fcilkplus_available
> executable {
> +	#ifdef __cplusplus
> +	extern "C"
> +	#endif
> +	    int dummy;
> +	} "-fcilkplus" ]
>  }
> 
>  proc check_linker_plugin_available { } {
> 
> 
> Testsuite shows no regression when run with
>   + an arm-none-eabi GCC cross-compiler targeting Cortex-M3
>   + a bootstrapped x86_64-linux-gnu GCC native compiler
> 
> Is this ok for trunk?
> 
> Best regards,
> 
> Thomas
> 


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

end of thread, other threads:[~2015-12-17  8:44 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-09  9:56 [PATCH, testsuite] Fix PR68629: attr-simd-3.c failure on arm-none-eabi targets Thomas Preud'homme
2015-12-10 21:50 ` Jeff Law
2015-12-15 16:45 ` Thomas Schwinge
2015-12-17  8:03   ` Thomas Schwinge
2015-12-17  8:26     ` Jakub Jelinek
2015-12-17  8:34       ` Thomas Preud'homme
2015-12-17  8:44 ` Thomas Preud'homme

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