------- Comment #2 from rguenth at gcc dot gnu dot org 2007-09-19 15:59 ------- Technically the testcase invokes undefined behavior because 'val' overflows during loop execution. Practically from a QOI point of view the undefinedness should not propagate to the loop exit test (though GCCs behavior is certainly standard conforming here). A nice example for what undefined behavior can cause though ;)
So, not sure if invalid or not. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33498