Re: [PATCH, rs6000] Undefine vector, bool, pixel in xmmintrin.h

2018-04-05 Thread Jakub Jelinek
On Wed, Apr 04, 2018 at 03:47:18PM -0500, Bill Schmidt wrote:
> > If we (for GCC9?) want to create a spot for target C++ tests, we should
> > just add g++.target// directories and add all the needed infrastructure
> > for those.
> > 
> > Can you please revert the powerpc.exp change and move the test to
> > g++.dg/ext/ ?  Thanks.
> 
> Sure, I can -- I just want to point out that there is precedent here.  I 
> noticed

Thanks.

> that gcc.target/s390/s390.exp allows .C suffixes and there is one such
> (compile-only) test in that directory, so I assumed the framework was okay
> for this.

Yes, and apparently aarch64 and arm have a couple of *.C tests too.
Still it doesn't feel right, running C++ tests under make check-gcc rather
than check-g++ is just weird.

I think we should just introduce g++.target/ in GCC9 and move those tests
there, plus any g++.dg/ tests guarded for single targets only.  g++.target
should do the -std=c++{98,11,14,17,2a} cycling etc.

Jakub


Re: [PATCH, rs6000] Undefine vector, bool, pixel in xmmintrin.h

2018-04-04 Thread Bill Schmidt
On Apr 4, 2018, at 3:51 PM, Jakub Jelinek  wrote:
> 
> On Wed, Apr 04, 2018 at 03:47:18PM -0500, Bill Schmidt wrote:
>>> If we (for GCC9?) want to create a spot for target C++ tests, we should
>>> just add g++.target// directories and add all the needed infrastructure
>>> for those.
>>> 
>>> Can you please revert the powerpc.exp change and move the test to
>>> g++.dg/ext/ ?  Thanks.
>> 
>> Sure, I can -- I just want to point out that there is precedent here.  I 
>> noticed
> 
> Thanks.
> 
>> that gcc.target/s390/s390.exp allows .C suffixes and there is one such
>> (compile-only) test in that directory, so I assumed the framework was okay
>> for this.
> 
> Yes, and apparently aarch64 and arm have a couple of *.C tests too.
> Still it doesn't feel right, running C++ tests under make check-gcc rather
> than check-g++ is just weird.
> 
> I think we should just introduce g++.target/ in GCC9 and move those tests
> there, plus any g++.dg/ tests guarded for single targets only.  g++.target
> should do the -std=c++{98,11,14,17,2a} cycling etc.

Agreed.  I'll take a note about this for GCC9.

Thanks,
Bill


Re: [PATCH, rs6000] Undefine vector, bool, pixel in xmmintrin.h

2018-04-04 Thread Bill Schmidt

> On Apr 4, 2018, at 3:53 AM, Jakub Jelinek  wrote:
> 
> On Sun, Apr 01, 2018 at 08:24:32PM -0500, Bill Schmidt wrote:
>> I also updated the gcc.target/powerpc/powerpc.exp file to allow C++
>> tests to be placed in that directory (with a *.C suffix).
> 
> I think this is wrong.
> Historically, we've been putting target C++ tests into g++.dg/*/*.C
> with appropriate target guards, the gcc.target/ tests are compiled with the
> gcc driver rather than g++, so in your case it just happens to work because
> it is a compile time test only (and one that doesn't use any STL headers),
> e.g. dg-do run test would fail miserably.
> 
> If we (for GCC9?) want to create a spot for target C++ tests, we should
> just add g++.target// directories and add all the needed infrastructure
> for those.
> 
> Can you please revert the powerpc.exp change and move the test to
> g++.dg/ext/ ?  Thanks.

Sure, I can -- I just want to point out that there is precedent here.  I noticed
that gcc.target/s390/s390.exp allows .C suffixes and there is one such
(compile-only) test in that directory, so I assumed the framework was okay
for this.

Thanks,
Bill

> 
>   Jakub
> 



Re: [PATCH, rs6000] Undefine vector, bool, pixel in xmmintrin.h

2018-04-04 Thread Jakub Jelinek
On Sun, Apr 01, 2018 at 08:24:32PM -0500, Bill Schmidt wrote:
> I also updated the gcc.target/powerpc/powerpc.exp file to allow C++
> tests to be placed in that directory (with a *.C suffix).

I think this is wrong.
Historically, we've been putting target C++ tests into g++.dg/*/*.C
with appropriate target guards, the gcc.target/ tests are compiled with the
gcc driver rather than g++, so in your case it just happens to work because
it is a compile time test only (and one that doesn't use any STL headers),
e.g. dg-do run test would fail miserably.

If we (for GCC9?) want to create a spot for target C++ tests, we should
just add g++.target// directories and add all the needed infrastructure
for those.

Can you please revert the powerpc.exp change and move the test to
g++.dg/ext/ ?  Thanks.

Jakub


Re: [PATCH, rs6000] Undefine vector, bool, pixel in xmmintrin.h

2018-04-03 Thread Segher Boessenkool
Hi Bill,

On Sun, Apr 01, 2018 at 08:24:32PM -0500, Bill Schmidt wrote:
>   * gcc.target/powerpc/undef-bool.C: New file.
>   * gcc.target/powerpc/undef-bool.c: New file.

I'm not sure two files with the same basename will not cause problems.
In either case it is confusing.  Please rename one?

> --- gcc/config/rs6000/xmmintrin.h (revision 258958)
> +++ gcc/config/rs6000/xmmintrin.h (working copy)
> @@ -58,6 +58,18 @@
>  #define _XMMINTRIN_H_INCLUDED
>  
>  #include 
> +
> +/* Avoid collisions between altivec.h and strict adherence to C++ and
> +   C11 standards.  This should eventually be done inside altivec.h itself,
> +   but only after testing a full distro build.  */
> +#if defined(__STRICT_ANSI__) && (defined(__cplusplus) || \
> +  (defined(__STDC_VERSION__) &&  \
> +   __STDC_VERSION__ >= 201112L))
> +#undef vector
> +#undef pixel
> +#undef bool
> +#endif

This won't work if anything made a macro for bool (etc.) before including
this header.  I guess we can live with that for now (it will not work
without your patch either).

Okay for trunk (with the testcase name fix).  Thanks!


Segher