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
On Thu, 2008-09-18 at 13:21 -0700, Richard Henderson wrote:
> Steve Ellcey wrote:
> > Setting REG_POINTER in do_replace is the only one that is necessary to
> > fix my bug. I just changed the others in an attempt to be complete.
>
> The change in do_replace is ok.
>
> For the others, where the new rtx is created by maybe_mode_change,
> it's unclear which of ORIG or COPY would have the correct value for
> REG_POINTER. It's also unclear why you'd be changing modes like
> that for real pointer values. I suppose if mode==orig_mode and
> orig had reg_pointer set, that'd be good enough to set it in the
> new rtx.
>
>
> r~
I tested the following patch where I set REG_POINTER in do_replace and
do not make any other changes. It fixes
gcc.c-torture/compile/20010102-1.c, gcc.c-torture/compile/20041018-1.c,
and gcc.c-torture/execute/builtins/memset-chk.c on IA64 HP-UX and causes
no regressions.
Is this version of the patch OK for checkin? I wasn't sure if your
OK comment was an official approval of that part of the patch or not.
2008-08-19 Steve Ellcey <sje@cup.hp.com>
* regrename.c (do_replace): Copy REG_POINTER value to new reg.
Index: regrename.c
===================================================================
--- regrename.c (revision 140482)
+++ 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;