------- 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