[Bug c/27007] Missed optimization of comparison with 'limited range'

joseph at codesourcery dot com gcc-bugzilla@gcc.gnu.org
Mon Apr 3 19:22:00 GMT 2006



------- Comment #2 from joseph at codesourcery dot com  2006-04-03 19:22 -------
Subject: Re:  Missed optimization of comparison with 'limited
 range'

On Mon, 3 Apr 2006, pinskia at gcc dot gnu dot org wrote:

> x+1 can wrap so try x be UINT_MAX.

Wrong.  The test uses *unsigned char*.  In the normal case of int wider 
than unsigned char, this promotes to int, so x+1 has range [1, UCHAR_MAX+1].


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27007



More information about the Gcc-bugs mailing list