This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/30315] optimize unsigned-add overflow test on x86 to use cpu flags from addl
- From: "rask at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 10 Nov 2007 01:32:20 -0000
- Subject: [Bug target/30315] optimize unsigned-add overflow test on x86 to use cpu flags from addl
- References: <bug-30315-11337@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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