This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/52208] New: [4.7 Regression] Useless store
- From: "hjl.tools at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 11 Feb 2012 01:50:18 +0000
- Subject: [Bug target/52208] New: [4.7 Regression] Useless store
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52208
Bug #: 52208
Summary: [4.7 Regression] Useless store
Classification: Unclassified
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: target
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: hjl.tools@gmail.com
CC: ubizjak@gmail.com
Target: x86_64
[hjl@gnu-6 pr52146]$ cat a.i
int test5() {
int* apic_tpr_addr = (int *)0xfee00080;
return *apic_tpr_addr + 5;
}
[hjl@gnu-6 pr52146]$ gcc -S -O a.i
[hjl@gnu-6 pr52146]$ cat a.s
.file "a.i"
.text
.globl test5
.type test5, @function
test5:
.LFB0:
.cfi_startproc
movabsl 4276093056, %eax
addl $5, %eax
ret
.cfi_endproc
.LFE0:
.size test5, .-test5
.ident "GCC: (GNU) 4.6.1 20110908 (Red Hat 4.6.1-9)"
.section .note.GNU-stack,"",@progbits
[hjl@gnu-6 pr52146]$ /export/build/gnu/gcc/build-x86_64-linux/gcc/xgcc
-B/export/build/gnu/gcc/build-x86_64-linux/gcc/ -S -O a.i
[hjl@gnu-6 pr52146]$ cat a.s
.file "a.i"
.text
.globl test5
.type test5, @function
test5:
.LFB0:
.cfi_startproc
movabsl 4276093056, %eax
movl %eax, -4(%rsp)
addl $5, %eax
ret
.cfi_endproc
.LFE0:
.size test5, .-test5
.ident "GCC: (GNU) 4.7.0 20120209 (experimental)"
.section .note.GNU-stack,"",@progbits
[hjl@gnu-6 pr52146]$
GCC 4.7 generates extra store:
movl %eax, -4(%rsp)