This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/29294] 4.1, 4.2 (possibly 4.0?) not finding postmodify address mode on ARM
- From: "eplondke at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 6 Oct 2006 14:55:54 -0000
- Subject: [Bug rtl-optimization/29294] 4.1, 4.2 (possibly 4.0?) not finding postmodify address mode on ARM
- References: <bug-29294-9933@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #5 from eplondke at gmail dot com 2006-10-06 14:55 -------
Here's what's going on in this case:
CSE changes an address if:
A) The cost of the address is lower
or
B) The cost of the address is the same and the cost of the RTX would be
higher outside of an address
So, CSE changes (R) to (R+4) because it is lower cost as specified by the
address_costs hook.
It doesn't change beyond (R+4) because (R+8) is the same cost as (R+4).
Once the address (R+4) gets in the RTL sequence, it never gets converted to
a postincrement form.
So by adding the cost of a simple REG RTX as being lower than (+ (REG) (CONST))
in the addressing modes, CSE doesn't convert the address to base+offset, and
we get the postincrement code back again in 4.x.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29294