------- Comment #41 from amacleod at redhat dot com 2008-02-01 17:46 ------- TER will not replace any load into an expression if there is more than one use of the load. Your sample shows multiple uses of each load. If it did this substitution, it could be introducing worse code, it doesn't know. (TER is also strictly a single block replacement as well).
A stand alone register pressure analysis could determine that those loads should all be substituted because pressure is too high on an 8 register machine. If there were 128 register available however, then it may not want to substitute the loads. TER just doesn't have that kind of information. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17863