------- Comment #4 from andi-gcc at firstfloor dot org 2009-08-07 08:50 ------- The RTL loop optimizer does this optimization. I had to fix it a couple of years ago for unsigned variables.
I think the loop optimizer still does it, just the gcc 4 frontend doesn't give it input RTL with a suitable pattern anymore. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40886