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 middle-end/44608] unspecified signed overflow applied to unsigned int



------- 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


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