This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] PR35371 GCSE loses track of REG_POINTER attribute


Peter Bergner <bergner@vnet.ibm.com> writes:
> Index: gcse.c
> ===================================================================
> --- gcse.c	(revision 132568)
> +++ gcse.c	(working copy)
> @@ -818,6 +818,24 @@ gcse_main (rtx f ATTRIBUTE_UNUSED)
>  
>  /* Misc. utilities.  */
>  
> +/* Create a pseudo reg to copy the result of a reaching expression into.
> +   Be careful to inherit the REG_POINTER attribute.  */
> +
> +static rtx
> +gen_reaching_reg_rtx (rtx x)
> +{
> +  rtx reg;
> +
> +  gcc_assert (REG_P (x));
> +
> +  reg = gen_reg_rtx (GET_MODE (x));
> +
> +  if (REG_POINTER (x))
> +    mark_reg_pointer (reg, REGNO_POINTER_ALIGN (REGNO (x)));
> +
> +  return reg;
> +}
> +

Minor suggestion, but maybe this could go in emit-rtl.c, under a more
generic name?  Given the performance impact of losing pointer info,
it would be nice to have a defined API for creating a register that's
like another.

Richard


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]