https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56917
Marek Polacek <mpolacek at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2014-11-03 CC| |mpolacek at gcc dot gnu.org Target Milestone|--- |5.0 Ever confirmed|0 |1 --- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> --- Confirmed, this can be seen with ubsan as well. The issue is that fold changes -(long int) (ul - 1) - 1 into (-long int) ul For e.g. ul = LONG_MAX+1 that shouldn't be done, I'm afraid.