http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50176
--- Comment #18 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-06-27 13:56:48 UTC --- Created attachment 27711 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27711 gcc48-pr50176.patch Here is an untested patch (hacked up on 4.7 branch, as the problem on this testcase seems to be only latent on the trunk). The patch will change a QImode load followed by SI=zext(QI) into a zero extending load on the first insn and a noop move on the second insn (which fwprop later optimizes even further. I had to add one new insn pattern in i386.md for it to trigger. But testing it now, it seems that that i386.md change alone is sufficient to fix up this testcase, because the combiner merges the two patterns then. I guess if it was different basic blocks it wouldn't, so am not sure if we want also the fwprop change or not. I'll bootstrap/regtest the i386.md change separately first.