This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Patch to fix gcc.c-torture/compile/20010102-1.c on IA64 HP-UX
- From: Peter Bergner <bergner at vnet dot ibm dot com>
- To: sje at cup dot hp dot com
- Cc: gcc-patches at gcc dot gnu dot org, paolo dot carlini at oracle dot com
- Date: Tue, 16 Sep 2008 13:20:31 -0500
- Subject: Re: Patch to fix gcc.c-torture/compile/20010102-1.c on IA64 HP-UX
- References: <200809161651.m8GGpEM19079@lucas.cup.hp.com>
On Tue, 2008-09-16 at 09:51 -0700, Steve Ellcey wrote:
> Index: regrename.c
> ===================================================================
> --- regrename.c (revision 140386)
> +++ regrename.c (working copy)
> @@ -357,11 +357,13 @@ do_replace (struct du_chain *chain, int
> {
> unsigned int regno = ORIGINAL_REGNO (*chain->loc);
> struct reg_attrs * attr = REG_ATTRS (*chain->loc);
> + int reg_ptr = REG_POINTER (*chain->loc);
>
> *chain->loc = gen_raw_REG (GET_MODE (*chain->loc), reg);
> if (regno >= FIRST_PSEUDO_REGISTER)
> ORIGINAL_REGNO (*chain->loc) = regno;
> REG_ATTRS (*chain->loc) = attr;
> + REG_POINTER (*chain->loc) = reg_ptr;
> df_insn_rescan (chain->insn);
> chain = chain->next_use;
> }
> @@ -1375,6 +1377,7 @@ find_oldest_value_reg (enum reg_class cl
> {
> ORIGINAL_REGNO (new_rtx) = ORIGINAL_REGNO (reg);
> REG_ATTRS (new_rtx) = REG_ATTRS (reg);
> + REG_POINTER (new_rtx) = REG_POINTER (reg);
> return new_rtx;
> }
> }
> @@ -1673,6 +1676,7 @@ copyprop_hardreg_forward_1 (basic_block
> {
> ORIGINAL_REGNO (new_rtx) = ORIGINAL_REGNO (src);
> REG_ATTRS (new_rtx) = REG_ATTRS (src);
> + REG_POINTER (new_rtx) = REG_POINTER (src);
> if (dump_file)
> fprintf (dump_file,
> "insn %u: replaced reg %u with %u\n",
Would it make more sense to call gen_reg_rtx_and_attrs() and
set_reg_attrs_from_value() to get/set the REG_ATTRS and REG_POINTER
fields? There was also a bug (PR36533), where we shouldn't set the
REG_POINTER attribute for hard registers. I'm not sure if that's
possible here, but it doesn't seem to be checked. Using
set_reg_attrs_from_value() would protect us from that.
Peter