http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51023
--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-11-09 09:39:28 UTC --- Created attachment 25765 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25765 gcc47-pr51023.patch Part of that patch is clearly bogus, as const_op here is a constant in wider mode than the inner mode of SIGN_EXTEND, thus before the comparison checked not just that the sign bit is clear, but also any bits above it. The simplify_set change from the same patch is questionable too.