During recent performance testing I have identified a number of small code fragments where gcc 4.x produces worse code than gcc 3.4.3. Some of these may be target specific, and I plan to gradually enter such small performance regressions into the bug database unless there is a better way to report these.
$ cat test.c long foo(long v) { return v & -v; } $ gcc-3.4.3 -O3 -c test.c && objdump -d test.o test.o: file format elf64-x86-64 Disassembly of section .text: 0000000000000000 <foo>: 0: 48 89 f8 mov %rdi,%rax 3: 48 f7 d8 neg %rax 6: 48 21 f8 and %rdi,%rax 9: c3 retq $ gcc-4.1-20050516 -O3 -c test.c && objdump -d test.o test.o: file format elf64-x86-64 Disassembly of section .text: 0000000000000000 <foo>: 0: 48 89 f8 mov %rdi,%rax 3: 48 f7 d8 neg %rax 6: 48 21 c7 and %rax,%rdi 9: 48 89 f8 mov %rdi,%rax c: c3 retq -- Summary: code-generation regression Product: gcc Version: 4.1.0 Status: UNCONFIRMED Severity: normal Priority: P2 Component: target AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: markus at oberhumer dot com CC: gcc-bugs at gcc dot gnu dot org GCC host triplet: x86_64-pc-linux http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21715