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 Tue, 2008-09-16 at 13:14 -0600, Jeff Law wrote:
> You don't necessarily need to set REG_POINTER on hard registers, and in
> general it's unwise.
>
> What we do is we set REG_POINTER on appropriate pseudos within the RTL
> for the pseudo. Then after register allocation/reloading, alter_reg
> changes the REGNO field for the pseudo to turn it into a hard register.
> Note this preserves the REG_POINTER flag so that you can test it after
> reload.
>
> So you'll need to look into where that insn was created and ensure that
> the appropriate pseudo has REG_POINTER set (r699) Then verify that it
> was carried forward through allocation/reloading.
>
> REG_POINTER, when set, indicates the object is a pointer for its entire
> lifetime -- thus setting it on hard registers is generally a bad idea
> and it's only safe under certain circumstances on pseudos, particularly
> in the presence of cross jumping.
So something similar to this untested patch to fix Steve's problem?
(This assumes ORIGINAL_REG (reg) == reg if reg is a psuedo. Maybe it
isn't. :)
Peter
--- config/ia64/predicates.md (revision 140251)
+++ config/ia64/predicates.md (working copy)
@@ -585,6 +585,6 @@ (define_predicate "ar_pfs_reg_operand"
(define_predicate "basereg_operand"
(match_operand 0 "register_operand")
{
- return REG_P (op) && REG_POINTER (op);
+ return REG_P (op) && REG_POINTER (regno_reg_rtx[ORIGINAL_REGNO
(op)]);
})