Hi Mike,

On Tue, Jul 16, 2019 at 02:19:14AM -0400, Michael Meissner wrote:
> I have changed the TARGET_TOC to be TARGET_HAS_TOC in the aix, darwin, system
> V, and Linux 64-bit headers.  Then in rs6000.h, TARGET_TOC is defined in terms
> of TARGET_HAS_TOC and not pc-relative referencing.

Cool, thanks.  Good name, too.

> I discovered that TARGET_NO_TOC must not be set to be just !TARGET_TOC, since
> TARGET_NO_TOC is used to create the elf_high, elf_low insns in 32-bit.

I don't know if your setting in sysv4.h works.  This file is used on so
very many platforms, it is hard to predict if it works everywhere :-/

> I did rename the static variable 'set' that contained the alias set to
> TOC_alias_set.

:-)

> I did not move the initialization of the TOC_alias_set
> elsewhere, because in order to call TOC_alias_set, the code has already called
> force_const_mem, create_TOC_reference, and gen_const_mem, so I didn't see the
> point of adding a micro-optimization for this.

It gets rid of a call, but also of the conditional, and that makes this
eminently inlinable.  You could remove the getter function completely
even, access the variable directly.

But, sure, that's existing code only now.

> Index: gcc/config/rs6000/linux64.h
> ===================================================================
> --- gcc/config/rs6000/linux64.h       (revision 273457)
> +++ gcc/config/rs6000/linux64.h       (working copy)
> @@ -277,8 +277,8 @@ extern int dot_symbols;
>  #ifndef RS6000_BI_ARCH
>  
>  /* 64-bit PowerPC Linux always has a TOC.  */
> -#undef  TARGET_TOC
> -#define      TARGET_TOC              1
> +#undef  TARGET_HAS_TOC
> +#define      TARGET_HAS_TOC          1

Fix the tab while your at it?  Not that it is consistent at all in this
file, but having the undef and the define in different style... :-)


So, what does TARGET_NO_TOC mean now?  Maybe a better name would help,
or some documentation if not?

Looks good otherwise, okay for trunk.  Thanks!

(And watch out if it works on AIX and Darwin, please).


Segher

Reply via email to