------- Comment #3 from rguenth at gcc dot gnu dot org  2010-01-16 13:34 -------
Actually it doesn't optimize 3*x%3 as if it were 0 but simply uses signed
arithmetic for the modulo operation resulting in a -2 modulus.

Using ((unsigned)(3 * x)) % 3 will get what you expect.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID


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

Reply via email to