------- Comment #17 from bergner at vnet dot ibm dot com 2006-10-03 03:30
-------
Created an attachment (id=12375)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=12375&action=view)
Patch to swap_commutative_operands_p and gen_addr_rtx to force base pointers
into rA position of indexed load/store instructions.
We propagated the MEM_POINTER/REG_POINTER flags fine. The problem is that the
memory reference we're handed is a REG + REG which looks legitimate to us, so
we never call LEGITIMIZE_ADDRESS, so we never have a chance to swap the
operands.
Since we cannot fixup the latest test case in LEGITIMIZE_ADDRESS, I've decided
to attempt another swap_commutative_operands_p() /
commutative_operand_precedence() change. However, I'm a little more selective
on when we change swap_commutative_operands_p()'s return value. With this
patch, I'm able to transform each of the test cases so that the base address if
the first operand of the indexed load.
* rtlanal.c (swap_commutative_operands_p): Preference a REG_POINTER
over a non REG_POINTER.
* tree-ssa-address.c (gen_addr_rtx): Force a REG_POINTER to be
the first operand of a PLUS.
--
bergner at vnet dot ibm dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #12305|0 |1
is obsolete| |
Attachment #12306|0 |1
is obsolete| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28690