reload autoinc fix

Bernd Schmidt
Tue Jan 7 16:17:00 GMT 2014

This is PR56791. The address inside of an autoinc is reloaded, and the 
autoinc is reloaded, but the reload insns are emitted in the wrong order.

As far as I can tell, this is because find_reloads_address_1 has two 
methods of pushing a reload for an autoinc, one of them using the 
previously identified type, and the other (better one) using 
RELOAD_OTHER. If we previously reloaded an inner part of the address, 
the use of RELOAD_OTHER is mismatched and leads to the wrong order of insns.

This patch just remembers if we've pushed a reload, and forces the 
optimization to be skipped in that case. Bootstrapped and tested on 
x86_64-linux (with lra_p disabled but still somewhat pointlessly); John 
Anglin said in the PR that it tests ok on PA. Will commit in a few days 
if no objections.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: autoinc-other.diff
Type: text/x-patch
Size: 1290 bytes
Desc: not available
URL: <>

More information about the Gcc-patches mailing list