https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83133
--- Comment #12 from Maxim Egorushkin <maxim.yegorushkin at gmail dot com> --- (In reply to jos...@codesourcery.com from comment #7) > On Fri, 24 Nov 2017, maxim.yegorushkin at gmail dot com wrote: > > > This code underflows a signed integer, which is undefined behaviour, if I am > > not mistaken. So, this would not be a valid example, would it? > > It's valid to call a function in another file compiled with another > compiler that follows the ABI, or compiled with -fwrapv, or not written in > C at all. That amounts to saying that the extra test instruction should only be emitted when compiling with -fwrapv. Is that right?