http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46675
--- Comment #20 from rguenther at suse dot de <rguenther at suse dot de> 2010-11-28 17:22:58 UTC --- On Sun, 28 Nov 2010, hjl.tools at gmail dot com wrote: > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46675 > > --- Comment #19 from H.J. Lu <hjl.tools at gmail dot com> 2010-11-28 17:20:23 > UTC --- > Good original dump: > > int npairs; > int i; > > int npairs; > int i; > npairs = (int) ((unsigned int) n + 2147483648); > > Bad dump: > > int npairs; > int i; > > int npairs; > int i; > npairs = n - -2147483648; > > We seem to fail to handle overflow for - -2147483648 at very start. Both dumps are ok, but writing n - -2147483648 makes it unsigned (you can't literally write INT_MIN). You're on the wrong track. Richard.