------- Comment #1 from rguenth at gcc dot gnu dot org  2007-02-08 09:34 -------
Confirmed.  The duplicate warnings are annoying.  Note that the warning is
emitted because we change n -= 2 to n += 4294967294 (oops).

>From the .original tree dump:

{
  goto <D1972>;
  <D1971>:;
  n = n + 4294967294;
  <D1972>:;
  if (n > 10) goto <D1971>; else goto <D1973>;
  <D1973>:;
}

this is because 2 is easily negatable and the canonical form in this case
is an addition.  While we can fix that, the loop optimizer should be fixed
as well to note that this unsigned addition is just a subtraction of two.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rguenth at gcc dot gnu dot
                   |                            |org, rakdver at gcc dot gnu
                   |                            |dot org
             Status|UNCONFIRMED                 |NEW
          Component|c                           |tree-optimization
     Ever Confirmed|0                           |1
  GCC build triplet|any                         |
   GCC host triplet|any                         |
 GCC target triplet|any                         |
           Keywords|                            |diagnostic
   Last reconfirmed|0000-00-00 00:00:00         |2007-02-08 09:34:14
               date|                            |


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

Reply via email to