Re: [RFA][rtl-optimization/52714] Do not allow combine to create invalid RTL

2014-02-27 Thread Jeff Law
On 02/17/14 02:28, Eric Botcazou wrote: Although it's probably time to concede defeat in this particular case, I don't think we should use the NONJUMP_INSN_P big hammer because we want to eliminate branches if possible. So I'd just add the minimal test to the two existing conditions so as to pr

Re: [RFA][rtl-optimization/52714] Do not allow combine to create invalid RTL

2014-02-24 Thread Jeff Law
On 02/17/14 02:28, Eric Botcazou wrote: So, the code has this structure if (looks safe) emit in existing order else if (reverse order looks safe) emit in reversed order else undo_all In this specific case, the existing order is never going to look safe because set1 uses (sp) as an

Re: [RFA][rtl-optimization/52714] Do not allow combine to create invalid RTL

2014-02-17 Thread Eric Botcazou
> So, the code has this structure > > if (looks safe) >emit in existing order > else if (reverse order looks safe) >emit in reversed order > else >undo_all > > > In this specific case, the existing order is never going to look safe > because set1 uses (sp) as an input argument and us

Re: [RFA][rtl-optimization/52714] Do not allow combine to create invalid RTL

2014-02-14 Thread Jeff Law
On 02/11/14 02:06, Eric Botcazou wrote: I pondered changing the condition for swapping the insn order, but it didn't seem worth it. I doubt we see many 3->2 combinations where I3 is a JUMP_INSN, the result turns into two simple sets and the insn swapping code you wrote decides it needs to swap t

Re: [RFA][rtl-optimization/52714] Do not allow combine to create invalid RTL

2014-02-11 Thread Jeff Law
On 02/11/14 02:06, Eric Botcazou wrote: I pondered changing the condition for swapping the insn order, but it didn't seem worth it. I doubt we see many 3->2 combinations where I3 is a JUMP_INSN, the result turns into two simple sets and the insn swapping code you wrote decides it needs to swap t

Re: [RFA][rtl-optimization/52714] Do not allow combine to create invalid RTL

2014-02-11 Thread Eric Botcazou
> I pondered changing the condition for swapping the insn order, but it > didn't seem worth it. I doubt we see many 3->2 combinations where I3 is > a JUMP_INSN, the result turns into two simple sets and the insn swapping > code you wrote decides it needs to swap the insns. I didn't actually write

Re: [RFA][rtl-optimization/52714] Do not allow combine to create invalid RTL

2014-02-09 Thread Jeff Law
On 02/08/14 03:44, Eric Botcazou wrote: This is then combined into: newpat = (parallel [ (set (pc) (pc)) (set (reg/v/f:SI 34 [ stack ]) (reg/f:SI 15 %sp)) ]) This isn't a recognized insn, and it needs to be split. Since it's just a parallel

Re: [RFA][rtl-optimization/52714] Do not allow combine to create invalid RTL

2014-02-08 Thread Eric Botcazou
> This is then combined into: > > newpat = (parallel [ > (set (pc) > (pc)) > (set (reg/v/f:SI 34 [ stack ]) > (reg/f:SI 15 %sp)) > ]) > > This isn't a recognized insn, and it needs to be split. Since it's just > a parallel of independent sets, com

[RFA][rtl-optimization/52714] Do not allow combine to create invalid RTL

2014-02-06 Thread Jeff Law
As mentioned in the PR, we call try_combine with: i1 = (insn 14 13 16 2 (set (reg/v/f:SI 34 [ stack ]) (reg/f:SI 15 %sp)) pr52714.c:9 38 {*movsi_m68k2} (nil)) i2 = (insn 16 14 17 2 (set (cc0) (compare (reg/v/f:SI 34 [ stack ]) (const_int 0 [0]))) pr52714.c:10 4