This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] PR35371 GCSE loses track of REG_POINTER attribute
- From: Richard Sandiford <rsandifo at nildram dot co dot uk>
- To: Peter Bergner <bergner at vnet dot ibm dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 26 Feb 2008 17:29:54 +0000
- Subject: Re: [PATCH] PR35371 GCSE loses track of REG_POINTER attribute
- References: <20080225222624.GA26857@vervain.rchland.ibm.com>
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