This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH,testsuite] add powerpc_spe_ok effective target
On Wed, 2009-01-14 at 07:13 -0800, Nathan Froyd wrote:
> On Tue, Jan 13, 2009 at 11:26:33AM -0800, Janis Johnson wrote:
> > On Tue, 2009-01-13 at 11:00 -0800, Nathan Froyd wrote:
> > > If we have a multilib that already specifies -mcpu=, then some of the
> > > SPE-related tests in the testsuite lead to errors, because the multilib
> > > -mcpu= is incompatible with the dg-options -mcpu=. Fixed by adding an
> > > effective target powerpc_spe_ok and using it where appropriate.
> >
> > Instead of doing it this way, look at Joel Sherrill's recent patch
> > http://gcc.gnu.org/ml/gcc-patches/2009-01/msg00470.html and follow that
> > model instead: use powerpc-spe-nocache for the effective-target keyword
> > and call the nocache version of check_no_compiler_messages with
> > [current_compiler_flags] instead of the specific list, and use
> > dg-skip-if after dg-options.
>
> OK, updated patch below. Tested on powerpc-none-eabi{,spe}.
>
> (I considered trying to merge c_e_t_powerpc_spe{,_nocache}, but found
> that it made things less clear, so I opted to just use the *_nocache bit
> where obviously conflicting dg-options were used.)
>
> -Nathan
>
> 2009-01-14 Daniel Jacobowitz <dan@codesourcery.com>
> Nathan Froyd <froydnj@codesourcery.com>
> Joseph Myers <joseph@codesourcery.com>
>
> * lib/target-supports.exp (check_effective_target_powerpc_spe_nocache):
> New function.
> * gcc.target/powerpc/20030218-1.c: Skip if not powerpc_spe_nocache
> and use consistent CFLAGS.
> * gcc.target/powerpc/20030505.c: Likewise.
> * gcc.target/powerpc/20081204-1.c: Likewise.
> * gcc.target/powerpc/ppc-spe.c: Likewise.
> * gcc.target/powerpc/spe1.c: Likewise.
> * g++.dg/other/opaque-1.C: Likewise.
> * g++.dg/other/opaque-2.C: Likewise.
> * g++.dg/other/opaque-3.C: Likewise.
>
OK, with one change:
> Index: lib/target-supports.exp
> ===================================================================
> --- lib/target-supports.exp (revision 143372)
> +++ lib/target-supports.exp (working copy)
> @@ -1535,6 +1535,23 @@ proc check_effective_target_powerpc_spu
> }
> }
>
> +# Return 1 if this is a PowerPC SPE target. The check includes options
> +# specified by dg-options for this test, so don't cache the result.
> +
> +proc check_effective_target_powerpc_spe_nocache { } {
> + if { [istarget powerpc*-*-*] } {
> + return [check_no_compiler_messages_nocache powerpc_spe object {
> + #ifndef __SPE__
> + #error not SPE
> + #else
> + int dummy;
> + #endif
> + }]
should be } [current_compiler_options]] to get dg-options for this test
> + } else {
> + return 0
> + }
> +}
> +
> # Return 1 if this is a PowerPC target with SPE enabled.
>
> proc check_effective_target_powerpc_spe { } {