On Mon, Oct 26, 2020 at 7:35 PM Alan Modra <amo...@gmail.com> wrote:

> $ grep mcmodel gcc/config/rs6000/*.opt
> gcc/config/rs6000/aix64.opt:mcmodel=
> gcc/config/rs6000/aix64.opt:Known code models (for use with the -mcmodel= 
> option):
> gcc/config/rs6000/linux64.opt:mcmodel=
> gcc/config/rs6000/linux64.opt:Known code models (for use with the -mcmodel= 
> option):
>
> aix64.opt is used for all rs6000-aix targets, linux64.opt for 64-bit
> and biarch powerpc linux targets.  powerpc linux errors for -mcmodel
> when -m32 (yes, even when biarch Segher).  So the proper test is a
> little more complicated than any suggestion given so far.
>
> This looks correct to me, bearing in mind that the test is a duplicate
> of swaps-p8-21.c aimed specifically at testing -mcmodel=large.
>
>         * gcc.target/powerpc/swaps-p8-22.c: Enable only for aix and
>         -m64 linux.
>
> diff --git a/gcc/testsuite/gcc.target/powerpc/swaps-p8-22.c 
> b/gcc/testsuite/gcc.target/powerpc/swaps-p8-22.c
> index 83f6ab3a1c0..847aebccca8 100644
> --- a/gcc/testsuite/gcc.target/powerpc/swaps-p8-22.c
> +++ b/gcc/testsuite/gcc.target/powerpc/swaps-p8-22.c
> @@ -1,4 +1,4 @@
> -/* { dg-do compile } */
> +/* { dg-do compile { target { *-*-aix* || { *-*-linux* && lp64 } } } } */
>  /* { dg-require-effective-target powerpc_p8vector_ok } */
>  /* { dg-options "-O2 -mdejagnu-cpu=power8 -maltivec -mcmodel=large" } */

This is okay.

There's no pretty solution.

Or we enable -mcmodel= for all powerpc targets and make it a nop for
Darwin and PPC32 Linux.

Thanks, David

Reply via email to