Bug#106866: gcc-3.0: Optimisation: [i386] pointless jump before a call
Package: gcc-3.0
Version: 1:3.0.1-0pre010723
Severity: normal
I was playing with the noreturn flag when I noticed the following pointless
jump into a call instruction:
86: a1 00 00 00 00 mov 0x0,%eax
87: R_386_32 intpending
8b: 85 c0 test %eax,%eax
8d: 74 c9 je 58 <evalsubshell+0x58>
8f: eb 3b jmp cc <evalsubshell+0xcc>
91: 8d 76 00 lea 0x0(%esi),%esi
...
c8: eb d4 jmp 9e <evalsubshell+0x9e>
ca: 89 f6 mov %esi,%esi
cc: e8 fc ff ff ff call cd <evalsubshell+0xcd>
cd: R_386_PC32 doint
d1: 8d 76 00 lea 0x0(%esi),%esi
There are no other jumps to cc. That costed me 8 bytes and a pointless
jump.
The source that generated this can be fetched from
http://gondor.apana.org.au/~herbert/bugs/gcc-bug-1.tar.bz2
To reproduce, do:
gcc-3.0 -g -O2 -DUSE_DOINT -c eval.c
-- System Information
Debian Release: testing/unstable
Kernel Version: Linux gondolin 2.4.7-686-smp #1 SMP Sun Jul 22 14:00:21 EST 2001 i686 unknown
Versions of the packages gcc-3.0 depends on:
ii binutils 2.11.90.0.24-1 The GNU assembler, linker and binary utiliti
ii cpp-3.0 3.0.1-0pre0107 The GNU C preprocessor.
ii gcc-3.0-base 3.0.1-0pre0107 The GNU Compiler Collection (base package).
ii libc6 2.2.3-7 GNU C Library: Shared libraries and Timezone
ii libgcc1 3.0.1-0pre0107 GCC support library.
Reply to: