This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/30315] optimize unsigned-add overflow test on x86 to use cpu flags from addl



------- Comment #16 from rask at gcc dot gnu dot org  2007-11-10 01:32 -------
Two testcases which aren't optimized:

unsigned int bad1 (unsigned int a)
{
  unsigned int c = a - 1;
  if (c > a)
    abort ();
  else
    return c;
}

unsigned int bad2 (unsigned int a)
{
  unsigned int c = a - 2;
  if (c > a)
    abort ();
  else
    return c;
}

See also <URL:http://gcc.gnu.org/ml/gcc-patches/2007-10/msg01359.html>.


-- 


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]