Re: Reload generate invalid instruction on ppc64

2014-08-06 Thread Carrot Wei
I found the root cause. In function rs6000_preferred_reload_class, it specifically check the case that reload 0 into a VSX register, then the target reload class is VSX register. VSX instructions can't load a constant into VSX registers directly, I guess the author wanted to use a SUB or XOR instr

Re: Reload generate invalid instruction on ppc64

2014-08-05 Thread Segher Boessenkool
On Tue, Aug 05, 2014 at 01:32:00PM +0930, Alan Modra wrote: > On Mon, Aug 04, 2014 at 05:54:04PM -0700, Carrot Wei wrote: > > Another problem is in the definition of insn pattern "*movdi_internal64". > > > > (define_insn "*movdi_internal64" > > [(set (match_operand:DI 0 "nonimmediate_operand" >

Re: Reload generate invalid instruction on ppc64

2014-08-05 Thread Carrot Wei
On Mon, Aug 4, 2014 at 9:02 PM, Alan Modra wrote: > On Mon, Aug 04, 2014 at 05:54:04PM -0700, Carrot Wei wrote: >> Another problem is in the definition of insn pattern "*movdi_internal64". >> >> (define_insn "*movdi_internal64" >> [(set (match_operand:DI 0 "nonimmediate_operand" >> "=Y,r,r,r,r,r

Re: Reload generate invalid instruction on ppc64

2014-08-04 Thread Alan Modra
On Mon, Aug 04, 2014 at 05:54:04PM -0700, Carrot Wei wrote: > Another problem is in the definition of insn pattern "*movdi_internal64". > > (define_insn "*movdi_internal64" > [(set (match_operand:DI 0 "nonimmediate_operand" > "=Y,r,r,r,r,r,?m,?*d,?*d,r,*h,*h,r,?*wg,r,?*wm") > (match_oper

Re: Reload generate invalid instruction on ppc64

2014-08-04 Thread Carrot Wei
Another problem is in the definition of insn pattern "*movdi_internal64". (define_insn "*movdi_internal64" [(set (match_operand:DI 0 "nonimmediate_operand" "=Y,r,r,r,r,r,?m,?*d,?*d,r,*h,*h,r,?*wg,r,?*wm") (match_operand:DI 1 "input_operand" "r,Y,r,I,L,nF,d,m,d,*h,r,0,*wg,r,*wm,r"))] "T

Reload generate invalid instruction on ppc64

2014-07-28 Thread Carrot Wei
Hi Vlad When I use ppc64 gcc4.9 to compile an internal application I got an ICE due to an invalid instruction generated by reload. Before IRA, I have following insns: (insn 139 136 581 10 (set (reg:DI 567) (const_int 0 [0])) ./strings/stringpiece.h:205 discrim 1 520 {*movdi_internal64}