[Bug target/88271] Omit test instruction after add
bugzilla@poradnik-webmastera.com
gcc-bugzilla@gcc.gnu.org
Thu Dec 6 14:20:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88271
--- Comment #1 from Daniel Fruzynski <bugzilla@poradnik-webmastera.com> ---
I checked that in simple case when bit shift is used in "if", it is optimized:
[code]
void f();
void g();
void test(int n)
{
if (n << 1)
f();
else
g();
}
[/code]
[asm]
test(int):
add edi, edi
je .L2
jmp f()
.L2:
jmp g()
[/asm]
More information about the Gcc-bugs
mailing list