https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82072
Marek Polacek <mpolacek at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2017-09-01 CC| |mpolacek at gcc dot gnu.org Ever confirmed|0 |1 --- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> --- Confirmed. We have i = i - lmin where i is int and lmin is long int, so what we should produce is i = (int) ((long int) i - lmin) but instead we produce i = (int) ((unsigned int) i - (unsigned int) lmin); This is do_narrow at work.