This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/50107] [IRA, i386] allocates regiters in very non-optimal way
- 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: Thu, 18 Aug 2011 14:44:03 +0000
- Subject: [Bug rtl-optimization/50107] [IRA, i386] allocates regiters in very non-optimal way
- Auto-submitted: auto-generated
- References: <bug-50107-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50107
--- Comment #7 from H.J. Lu <hjl.tools at gmail dot com> 2011-08-18 14:44:03 UTC ---
Another problem is
[hjl@gnu-6 pr50107]$ cat udi.i
extern unsigned long long k2;
unsigned long long test_mul_64 (unsigned long a, unsigned long b)
{
k2 = (unsigned long long) a * b;
k2+=3;
return k2;
}
[hjl@gnu-6 pr50107]$ make udi.s PIC=-m32
/export/build/gnu/gcc-hsw/build-x86_64-linux/gcc/xgcc
-B/export/build/gnu/gcc-hsw/build-x86_64-linux/gcc/ -S -o udi.s -O2 -mbmi2 -m32
udi.i
[hjl@gnu-6 pr50107]$ cat udi.s
.file "udi.i"
.text
.p2align 4,,15
.globl test_mul_64
.type test_mul_64, @function
test_mul_64:
.LFB0:
.cfi_startproc
pushl %ebx
.cfi_def_cfa_offset 8
.cfi_offset 3, -8
movl 8(%esp), %edx
mulx 12(%esp), %ecx, %ebx
movl %ecx, %eax
movl %ebx, %edx
addl $3, %eax
adcl $0, %edx
movl %eax, k2
movl %edx, k2+4
popl %ebx
.cfi_restore 3
.cfi_def_cfa_offset 4
ret
.cfi_endproc
.LFE0:
.size test_mul_64, .-test_mul_64
.ident "GCC: (GNU) 4.7.0 20110817 (experimental)"
.section .note.GNU-stack,"",@progbits
[hjl@gnu-6 pr50107]$
EDX is the input of MULX and dead after MULX. IRA should allocate
EAD/EDX for the output of mulx.