This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/68328] [4.9/5/6 Regression] wrong code at -O2 and -O3 on x86_64-linux-gnu
- From: "ktkachov at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 17 Nov 2015 13:42:19 +0000
- Subject: [Bug rtl-optimization/68328] [4.9/5/6 Regression] wrong code at -O2 and -O3 on x86_64-linux-gnu
- Auto-submitted: auto-generated
- References: <bug-68328-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68328
--- Comment #8 from ktkachov at gcc dot gnu.org ---
The above testcase should be adjusted a bit for targets that have different
char signedness than x86:
int a, b, c = 1, d = 1, e;
__attribute__((noinline, noclone)) int
foo (void)
{
asm volatile ("" : : : "memory");
return 4195552;
}
__attribute__((noinline, noclone)) void
bar (int x, int y)
{
asm volatile ("" : : "g" (x), "g" (y) : "memory");
if (y == 0)
__builtin_abort ();
}
int
baz (int x)
{
char g, h;
int i, j;
foo ();
for (;;)
{
if (c)
h = d;
g = h < x ? h : 0;
i = (signed char) ((unsigned char)(g - 120) ^ 1);
j = i > 97;
if (a - j)
bar (0x123456, 0);
if (!b)
return e;
}
}
int
main ()
{
baz (2);
return 0;
}