------- Comment #9 from pinskia at gcc dot gnu dot org  2006-08-10 16:44 -------
Here is a testcase which makes this a regression:
extern void abort (void);
int
foo (unsigned int u)
{
  unsigned t;
  for (t=0;t!=u;t++) ;
  return (int)(t + 4) < (int)u;
}

int
main (int argc, char *argv[])
{
  unsigned int u;

  /* Run with no arguments so u will be MAX_INT and the optimizers
     won't know its value.  */
  if (argc > 1)
    u = 1;
  else
    u = 0x7fffffff;

  if (foo (u) == 0)
    abort();
  return 0;
}


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|signed compare incorrectly  |[4.0/4.1 Regression] signed
                   |false for (int)(U+4)<(int)U |compare incorrectly false
                   |where U is unsigned INT_MAX |for (int)(U+4)<(int)U where
                   |(for optimized  x86)        |U is unsigned INT_MAX (for
                   |                            |optimized  x86)
   Target Milestone|---                         |4.0.4


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

Reply via email to