This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/48085] New: [x32] Unnecessary zero-extension
- 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, 12 Mar 2011 01:54:37 +0000
- Subject: [Bug target/48085] New: [x32] Unnecessary zero-extension
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48085
Summary: [x32] Unnecessary zero-extension
Product: gcc
Version: 4.6.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: target
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: hjl.tools@gmail.com
[hjl@gnu-6 ilp32-31]$ cat y.c
int
foo (int *p)
{
return *p;
}
[hjl@gnu-6 ilp32-31]$ make y.s
/export/build/gnu/gcc-x32/build-x86_64-linux/gcc/xgcc
-B/export/build/gnu/gcc-x32/build-x86_64-linux/gcc/ -S -o y.s -mx32
-funroll-all-loops -O3 -dp y.c
[hjl@gnu-6 ilp32-31]$ cat y.s
.file "y.c"
.text
.p2align 4,,15
.globl foo
.type foo, @function
foo:
.LFB0:
.cfi_startproc
mov %edi, %edi # 2 *zero_extendsidi2_rex64/1 [length = 2]
movl (%rdi), %eax # 6 *movsi_internal/1 [length = 2]
ret # 20 return_internal [length = 1]
.cfi_endproc
.LFE0:
.size foo, .-foo
.ident "GCC: (GNU) 4.6.0 20110311 (experimental)"
.section .note.GNU-stack,"",@progbits
[hjl@gnu-6 ilp32-31]$
We don't need to zero-extend 32bit pointer in EDI to RDI.