[PATCH] rs6000: Entry point generation for functions using PC-relative addressing

Segher Boessenkool segher@kernel.crashing.org
Thu May 23 11:06:00 GMT 2019


Hi!

On Wed, May 22, 2019 at 06:39:55PM -0500, Bill Schmidt wrote:
> @@ -26191,6 +26191,10 @@ rs6000_global_entry_point_needed_p (void)
>    if (TARGET_SINGLE_PIC_BASE)
>      return false;
>  
> +  /* PC-relative functions never generate a global entry point prologue.  */
> +  if (rs6000_pcrel_p (cfun))
> +    return false;

"global_entry_point_needed" is such a confusing name; it isn't what this
function is about.  "global entry point prologue" like in your comment
is much closer to the truth, but also not exactly it.

Maybe we should rename this function.  And/or split it into two.

> +  const char *name = XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0);

This var is only used on some code paths.  Factor this better, instead?
This ties in with the previous point.

> --- /dev/null
> +++ b/gcc/testsuite/gcc.target/powerpc/localentry-1.c
> @@ -0,0 +1,19 @@
> +/* { dg-do compile } */
> +/* { dg-options "-mcpu=future -O2" } */
> +/* { dg-require-effective-target powerpc_elfv2 } */
> +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=future" } } */

Lose this last line, use -mdejagnu-cpu=future instead please.


Segher



More information about the Gcc-patches mailing list