Hi!

On Mon, May 18, 2020 at 04:02:34PM -0700, Douglas B Rupp wrote:
> The attached patch is proposed for rs6000/linux64.h.

(Please use inline patches if at all possible.  For example, your
replies left out the patch already).

> The problem it addresses is that the current checking only tests for 
> existence not for an incompatible/compatible setting.
> 
> For example:
> 
> $ powerpc64-linux-gnu-gcc -mcmodel=medium -mminimal-toc foo.c
> is an incompatible set of switches
> 
> however
> 
> $ powerpc64-linux-gnu-gcc -mcmodel=medium -mno-minimal-toc foo.c
> is ok.
> 
> Currently both are reported as incompatible.

> diff --git gcc/config/rs6000/linux64.h gcc/config/rs6000/linux64.h
> index 34776c8421e..6728006d208 100644
> --- gcc/config/rs6000/linux64.h
> +++ gcc/config/rs6000/linux64.h
> @@ -134,8 +134,10 @@ extern int dot_symbols;
>             rs6000_isa_flags |= OPTION_MASK_POWERPC64;        \
>             error ("%<-m64%> requires a PowerPC64 cpu");              \
>           }                                                   \
> -       if ((rs6000_isa_flags_explicit                        \
> -            & OPTION_MASK_MINIMAL_TOC) != 0)                 \
> +       if (((rs6000_isa_flags_explicit                       \
> +             & OPTION_MASK_MINIMAL_TOC) != 0) &&             \
> +           ((rs6000_isa_flags                                \
> +             & OPTION_MASK_MINIMAL_TOC) != 0))               \
>           {                                                   \
>             if (global_options_set.x_rs6000_current_cmodel    \
>                 && rs6000_current_cmodel != CMODEL_SMALL)     \

(only allow it with CMODEL_SMALL; no other action in this block).

Put that
  ((rs6000_isa_flags & OPTION_MASK_MINIMAL_TOC) != 0)
check inside the block please, together with the CMODEL_SMALL check?


Segher

Reply via email to