https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94247
--- Comment #2 from Roland Illig <roland.illig at gmx dot de> --- (In reply to Andrew Pinski from comment #1) > >and the compiler already knows this > Not when the warning is generated from the front-end. It does not know the > range of the char variable there. Ah, that fine distinction. From my point of view there only was "the compiler". If the range of the variable is not known at that time, it would probably be too much work to implement this extra rule. So you suggest that the code should be fixed instead? Then I'll tell the OpenJDK people.