http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46920
Vladimir Makarov <vmakarov at redhat dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |vmakarov at redhat dot com
--- Comment #1 from Vladimir Makarov <vmakarov at redhat dot com> 2010-12-13
21:03:48 UTC ---
Before IRA we have the following code
L43:
25 NOTE_INSN_BASIC_BLOCK
26 pc=r59:DI
REG_DEAD: r59:DI
i 27: barrier
L28:
29 NOTE_INSN_BASIC_BLOCK
30 r62:DI=r12:DI
REG_DEAD: r12:DI
31 {r63:DI=r62:DI+0x2;clobber flags:CC;}
REG_UNUSED: flags:CC
32 r12:DI=r63:DI
33 flags:CCZ=cmp([r62:DI+0x2],0)
REG_DEAD: r62:DI
34 pc={(flags:CCZ==0)?L39:pc}
REG_DEAD: flags:CCZ
REG_BR_PROB: 0x1388
35 NOTE_INSN_BASIC_BLOCK
36 r76:DI=sign_extend(r65:SI)
REG_DEAD: r65:SI
37 {r63:DI=r63:DI+r76:DI;clobber flags:CC;}
REG_DEAD: r76:DI
REG_UNUSED: flags:CC
38 r12:DI=r63:DI
L39:
40 NOTE_INSN_BASIC_BLOCK
41 r65:SI=sign_extend([r63:DI+0x1])
REG_DEAD: r63:DI
42 r59:DI=[r71:DI]
61 pc=L43
To generate the proposed code, we should assign r12 to p63. IRA marks p63
conflicting with r12 because DF-infrastructure reports r12 having intersected
live ranges with p63.
It is possible to solve the problem if we have conflicts based on values (not
live ranges). I'd not recommend to do that, because it will slow down RA
without visible improvement on majority benchmarks (I did such experiment about
7 years ago and reported about the results on GCC summit in 2004).
By the way, usage of implicit hard registers in RTL (when it can be avoided.
Example when hard registers can be avoided is their usage as call arguments) is
very bad idea for RA. I see it a lot such code in x86-64 code. I'd recommend
to prevent optimizations before RA to abuse hard register usage.