[Bug tree-optimization/47815] New: Tail call regression with GCC snapshot
adam at consulting dot net.nz
gcc-bugzilla@gcc.gnu.org
Sat Feb 19 11:23:00 GMT 2011
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47815
Summary: Tail call regression with GCC snapshot
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: tree-optimization
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: adam@consulting.net.nz
$ gcc-snapshot.sh --version
gcc (Debian 20110126-0ubuntu1) 4.6.0 20110126 (experimental) [trunk revision
169285]
If the code below is compiled with Debian sid gcc-snapshot no tail calls are
generated:
#include <assert.h>
__attribute__((noinline)) void tail_call0() {
assert("tail_call0"=="");
}
__attribute__((noinline)) void tail_call1() {
assert("tail_call1"=="");
}
void make_tail_calls(int flag) {
if (flag) tail_call0(); else tail_call1();
}
int main() {
return 0;
}
$ gcc-snapshot.sh -Os tail_call_regression.c && objdump -d -m i386:x86-64 a.out
|less
0000000000400508 <make_tail_calls>:
400508: 31 c0 xor %eax,%eax
40050a: 85 ff test %edi,%edi
40050c: 51 push %rcx
40050d: 74 05 je 400514 <make_tail_calls+0xc>
40050f: e8 c0 ff ff ff callq 4004d4 <tail_call0>
400514: e8 d5 ff ff ff callq 4004ee <tail_call1>
Expected output:
$ gcc-4.5 -Os tail_call_regression.c && objdump -d -m i386:x86-64 a.out |less
000000000040052e <make_tail_calls>:
40052e: 85 ff test %edi,%edi
400530: 74 07 je 400539 <make_tail_calls+0xb>
400532: 31 c0 xor %eax,%eax
400534: e9 bb ff ff ff jmpq 4004f4 <tail_call0>
400539: 31 c0 xor %eax,%eax
40053b: e9 d1 ff ff ff jmpq 400511 <tail_call1>
More information about the Gcc-bugs
mailing list