This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/44608] unspecified signed overflow applied to unsigned int
- From: "rguenth at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 21 Jun 2010 11:50:54 -0000
- Subject: [Bug middle-end/44608] unspecified signed overflow applied to unsigned int
- References: <bug-44608-19351@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #6 from rguenth at gcc dot gnu dot org 2010-06-21 11:50 -------
int __attribute__((noinline))
abssat2 (int x)
{
unsigned int y = x;
if (x < 0)
y = -y;
if (y >= 0x80000000)
y--;
return y;
}
extern void abort (void);
int main()
{
if (abssat2 (0x80000000) != 0x7fffffff)
abort ();
return 0;
}
does not fail on x86_64 or i?86.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44608