http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56051
--- Comment #4 from Marc Glisse <glisse at gcc dot gnu.org> 2013-01-20 18:09:40 UTC --- (In reply to comment #3) > Untested fix. As the testcase shows, also a widening conversion can be a > problem, if it extends from signed integral type to wider unsigned one, > because > then for Y equal to bitsize of the narrower type - 1 we get more than one bit > set. I assume this is because of the gcc extension documented as: "GCC does not use the latitude given in C99 only to treat certain aspects of signed `<<' as undefined, but this is subject to change." which prevents from assuming that 1<<n is positive. Maybe that can be changed at some point, as the documentation suggests? ;-) PS: sorry for setting it to the middle-end component, I mistakenly believed that tree-optimization was only for SSA.