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: "vmakarov at redhat dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 18 Aug 2011 18:24:42 +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 #10 from Vladimir Makarov <vmakarov at redhat dot com> 2011-08-18 18:24:42 UTC ---
(In reply to comment #9)
> With revision 177865 + MULX change, I got
>
> [hjl@gnu-6 pr50107]$ cat uti-2.i
> unsigned __int128 test_mul_64 (unsigned long long a, unsigned long long b)
> {
> return (unsigned __int128) a*b;
> }
> [hjl@gnu-6 pr50107]$ make uti-2.s
> /export/build/gnu/gcc-hsw/build-x86_64-linux/gcc/xgcc
> -B/export/build/gnu/gcc-hsw/build-x86_64-linux/gcc/ -S -o uti-2.s -O2 -mbmi2
> uti-2.i
> [hjl@gnu-6 pr50107]$ cat uti-2.s
> .file "uti-2.i"
> .text
> .p2align 4,,15
> .globl test_mul_64
> .type test_mul_64, @function
> test_mul_64:
> .LFB0:
> .cfi_startproc
> movq %rdi, %rdx
> mulx %rsi, %rax, %rsi
> movq %rsi, %rdx
> ret
> .cfi_endproc
> .LFE0:
> .size test_mul_64, .-test_mul_64
> .ident "GCC: (GNU) 4.7.0 20110818 (experimental)"
> .section .note.GNU-stack,"",@progbits
> [hjl@gnu-6 pr50107]$
>
> I would expect
>
> movq %rdi, %rdx
> mulx %rsi, %rax, %rdx
> ret
I think it i a reload problem. IRA assigns dx to pseudo 71 (an insn output)
but reload then spills it.