This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/34653] operation performed unnecessarily in 64-bit mode
- From: "ubizjak at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 3 Oct 2009 12:48:23 -0000
- Subject: [Bug target/34653] operation performed unnecessarily in 64-bit mode
- References: <bug-34653-5748@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #7 from ubizjak at gmail dot com 2009-10-03 12:48 -------
We regressed on the example from comment #1.
gcc-4.3 with -O2 generates:
foo:
movzbl (%rdi), %edx
movq %rdx, %rax
shrq $4, %rdx
andl $15, %eax
movq table(,%rax,8), %rax
addq table(,%rdx,8), %rax
ret
And gcc-4.4+ -O2 generates:
foo:
movzbl (%rdi), %eax
movq %rax, %rcx
>> movq %rax, %rdx
andl $15, %ecx
shrq $4, %rdx
movq table(,%rcx,8), %rax
addq table(,%rdx,8), %rax
ret
Please note extra move.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34653