http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53117
--- Comment #3 from Wouter Vermaelen <vermaelen.wouter at gmail dot com> 2012-04-25 15:30:42 UTC --- @Jakub: At first I was puzzled by your comment. But after some investigation I found out that this 'optimization' is indeed not possible when the subtraction would underflow. So you can close this bug report as invalid. (OTOH signed overflow is anyway undefined behavior in C).