http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47412
--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-01-22 17:31:03 UTC --- (In reply to comment #2) > It seems interesting for me. It means Java doesn't assume it as an undefined > behavior point or at least Java's compiler does in a unique way and doesn't > care about being X or Y. > Can anyone explain it? Java is a different language with different rules about evaluation of expressions. That code is well-defined in Java, but not C or C++ http://sgaur.wordpress.com/2009/03/30/java-evalorder-ops/ http://stackoverflow.com/questions/2028464/logic-differences-in-c-and-java/