This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/80620] [7/8 Regression] gcc produces wrong code with -O3
- 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, 04 May 2017 07:09:25 +0000
- Subject: [Bug tree-optimization/80620] [7/8 Regression] gcc produces wrong code with -O3
- Auto-submitted: auto-generated
- References: <bug-80620-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80620
--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Simplified testcase (for -O3):
long long int a = -465274079317386463LL;
int b = 856872806;
int c = -1940894202;
int d = 1718449211;
int e = -392681565;
unsigned long long int f = 13521452247506316486ULL;
int g = -13194608;
__attribute__((noinline, noclone))
void foo ()
{
if (!a - a)
c = b = 0;
else
d = 3UL * a == 0;
if (g / a)
e = 0 < -a + 500849970701012771LL + (unsigned long) -a;
else
f = 4081116982543369LL & a;
}
int
main ()
{
asm volatile ("" : : : "memory");
foo ();
if (f != 2818598057803777LL)
__builtin_abort ();
return 0;
}