This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/78726] [5/6/7 Regression] Incorrect unsigned arithmetic optimization
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 08 Dec 2016 10:01:41 +0000
- Subject: [Bug middle-end/78726] [5/6/7 Regression] Incorrect unsigned arithmetic optimization
- Auto-submitted: auto-generated
- References: <bug-78726-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78726
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jakub at gcc dot gnu.org
--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Single file testcase:
unsigned char b = 36, c = 173;
unsigned int d;
__attribute__((noinline, noclone)) void
foo (void)
{
unsigned a = ~b;
d = a * c * c + 1023094746 * a;
}
int
main ()
{
if (__SIZEOF_INT__ != 4 || __CHAR_BIT__ != 8)
return 0;
asm volatile ("" : : "g" (&b), "g" (&c) : "memory");
foo ();
if (d != 799092689)
__builtin_abort ();
return 0;
}