This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug inline-asm/47419] New: missed 'mov (base,index,scale),reg' optimization?
- From: "pluto at agmk dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 23 Jan 2011 01:33:11 +0000
- Subject: [Bug inline-asm/47419] New: missed 'mov (base,index,scale),reg' optimization?
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47419
Summary: missed 'mov (base,index,scale),reg' optimization?
Product: gcc
Version: 4.6.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: inline-asm
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: pluto@agmk.net
following code...
unsigned __attribute__((regparm(2)))
asm_read_mapped_register( unsigned* address, unsigned long index )
{
unsigned value;
asm /* reading has side-effects in hardware */ volatile (
"movl (%1), %0"
: /* output operands */ "=r" ( value )
: /* input operands */ "r" ( address + index )
: /* clobbers */
);
return value;
}
produces...
asm_read_mapped_register:
leaq (%rdi,%rsi,4), %rax
movl (%rax), %eax
ret
is it a bug in asm inline? why the 'movl (%rdi,%rsi,4),%eax' isn't emitted?