This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, testsuite] Fix PR68629: attr-simd-3.c failure on arm-none-eabi targets
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Thomas Schwinge <thomas at codesourcery dot com>
- Cc: "Thomas Preud'homme" <thomas dot preudhomme at arm dot com>, Jeff Law <law at redhat dot com>, gcc-patches at gcc dot gnu dot org, Tobias Burnus <burnus at net-b dot de>, Rainer Orth <ro at CeBiTec dot Uni-Bielefeld dot DE>
- Date: Thu, 17 Dec 2015 09:25:49 +0100
- Subject: Re: [PATCH, testsuite] Fix PR68629: attr-simd-3.c failure on arm-none-eabi targets
- Authentication-results: sourceware.org; auth=none
- References: <000301d13267$d8d086e0$8a7194a0$ at arm dot com> <877fkfhd9w dot fsf at kepler dot schwinge dot homeip dot net> <87fuz1pko0 dot fsf at kepler dot schwinge dot homeip dot net>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
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