http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56719
--- Comment #7 from felix-gcc at fefe dot de 2013-03-25 16:01:14 UTC --- I filed this bug because I was under the impression that gcc was already supposed to optimize this out as part of the value range optimizations. You probably know better than me whether the required effort would be disproportionate. I'd still vote for supporting this case because then I can go around and tell people to worry about writing readable code instead of worrying about code that the compiler will compile well.