This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/16797] Opportunity to remove unnecessary load instructions
- From: "steven at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 30 Jul 2004 18:11:34 -0000
- Subject: [Bug tree-optimization/16797] Opportunity to remove unnecessary load instructions
- References: <20040728170038.16797.steinmtz@us.ibm.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From steven at gcc dot gnu dot org 2004-07-30 18:11 -------
Interestingly, on AMD64 this test case doesn't even need a branch:
foo:
movq i(%rip), %rax # %rax <-- i
sarq $52, %rax # %rax <-- (%rax >> 52)
movq %rax, j(%rip) # j <-- %rax
sarq $11, %rax # %rax <-- (%rax >> 11)
andq $-10, %rax # %rax <-- (%rax & -10)
addq $20, %rax # %rax <-- (%rax + 20)
movq %rax, i(%rip) # i <-- %rax
ret # return %eax
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16797