Hi! On Wed, Apr 22, 2020 at 12:53:03AM -0400, Michael Meissner wrote: > 2020-04-21 Michael Meissner <meiss...@linux.ibm.com> > > * config/rs6000/linux64.h (PCREL_SUPPORTED_BY_OS): Define to > enable PC-relative addressing for -mcpu=future. > * config/rs6000/rs6000-cpus.def (ISA_FUTURE_MASKS_SERVER): Move > after OTHER_FUTURE_MASKS. Use OTHER_FUTURE_MASKS. > * config/rs6000/rs6000.c (PCREL_SUPPORTED_BY_OS): If not defined, > suppress PC-relative addressing. > (rs6000_option_override_internal): Split up error messages > checking for -mprefixed and -mpcrel. Enable -mpcrel if the target > system supports it. > > --- /tmp/ud7l8s_linux64.h 2020-04-21 16:09:26.761209165 -0400 > +++ gcc/config/rs6000/linux64.h 2020-04-21 16:04:59.432652447 -0400 > @@ -640,3 +640,10 @@ extern int dot_symbols; > enabling the __float128 keyword. */ > #undef TARGET_FLOAT128_ENABLE_TYPE > #define TARGET_FLOAT128_ENABLE_TYPE 1 > + > +/* Enable using prefixed PC-relative addressing on the 'future' machine if > the > + ABI supports it. The ELF v2 ABI only supports PC-relative relocations for > + the medium code model. */ > +#define PCREL_SUPPORTED_BY_OS (TARGET_FUTURE && TARGET_PREFIXED > \ > + && ELFv2_ABI_CHECK \ > + && (TARGET_CMODEL == CMODEL_MEDIUM))
No extra parens around comparisons please. If the macros malfunction without it, fix the macros! > + /* If the ABI has support for PC-relative relocations, enable it by > default. > + This test depends on the sub-target tests above setting the code model > to > + medium for ELF v2 systems. */ > + if (PCREL_SUPPORTED_BY_OS > + && (rs6000_isa_flags_explicit & OPTION_MASK_PCREL) == 0) > + rs6000_isa_flags |= OPTION_MASK_PCREL; > + > /* -mpcrel requires -mcmodel=medium, but we can't check TARGET_CMODEL until > after the subtarget override options are done. */ > - if (TARGET_PCREL && TARGET_CMODEL != CMODEL_MEDIUM) > + else if (TARGET_PCREL && TARGET_CMODEL != CMODEL_MEDIUM) > { > if ((rs6000_isa_flags_explicit & OPTION_MASK_PCREL) != 0) > error ("%qs requires %qs", "-mpcrel", "-mcmodel=medium"); If pcrel is enabled by the first if(), we still need to test for cmodel, I think? This same code won't work, of course. Okay for trunk with that first thing fixed, and that second thing can be dealt with in a later patch. Thanks! Segher