[Bug tree-optimization/58359] __builtin_unreachable prevents vectorization
glisse at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue Sep 17 13:31:00 GMT 2013
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58359
--- Comment #2 from Marc Glisse <glisse at gcc dot gnu.org> ---
Another optimization prevented by __builtin_unreachable:
extern void f();
void g(int i){
if(i>0){
f();
__builtin_unreachable();
}
}
misses that f is a tail call and generates at -O3 on x86_64:
testl %edi, %edi
jg .L6
rep ret
.L6:
pushq %rax
xorl %eax, %eax
call f
instead of (removing the builtin):
testl %edi, %edi
jle .L1
xorl %eax, %eax ( in C++ this line disappears )
jmp f
.L1:
rep ret
(it inverted the comparison, but my point is "call" vs "jmp")
More information about the Gcc-bugs
mailing list