http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59649
--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Two out of the 3 get_mode_bounds calls pass the same mode as the first and third argument, so in that case it would be BImode in both cases and even before Nick's change while min_val/max_val would be -128/127 for signed and 0/255 otherwise, as the value is then trunc_int_for_mode (into BImode again), which will return STORE_FLAG_VALUE for & 1 and 0 otherwise, the function returned 0 and STORE_FLAG_VALUE (for STORE_FLAG_VALUE == -1 a wrong thing to do supposedly, but that is not the case of ia64). I wonder if get_mode_bounds is ever called with BImode and some wider mode, that would mean there would need to be a conversion of some wider mode to BImode in the IL I think, which is quite unlikely. Normally BImode is the result of some comparison instead.