https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71753
--- Comment #4 from Ćukasz Spintzyk <lukasz.spintzyk at displaylink dot com> --- Yes, this code is utilizing overflow, but it is there for a reason to optimize the code and get rid of branches as they can slow down program execution. You can refer to http://locklessinc.com/articles/sat_arithmetic/ Looking from this point of view is this really invalid?