http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59999
--- Comment #4 from Paulo J. Matos <pa...@matos-sorge.com> --- (In reply to Richard Biener from comment #3) > Yes, I think that the IV choice merely shows that we miss to optimize the > extension - which would be somewhere in the RTL opt pipeline. Makes sense. My first instinct was to do it in expand but since expand does one gimple statement at a time it might be too much for it to handle since it probably has to detect the sign extend and promote the type of the register if there are no conflicting conditions. If you suggest where to do this kind of thing I can give it a try. Thanks.