Re: [RS6000] Force source of fix_truncsi2 to reg

2016-08-06 Thread Alan Modra
On Fri, Aug 05, 2016 at 04:25:26PM -0400, Michael Meissner wrote: > Ummm, this patch looks wrong. Because the insn uses the SFDF iterator, the > mode of operands[1] could be either SFmode or DFmode. I think it should be: > > - rtx tmp, stack; > + rtx src = force_reg (mode,

Re: [RS6000] Force source of fix_truncsi2 to reg

2016-08-05 Thread Michael Meissner
On Wed, Aug 03, 2016 at 12:02:54AM +0930, Alan Modra wrote: > This is a hack I tried to avoid having to poke at lra code for > pr71680.. > > The idea of adding force_reg here was that it removes subregs from > fix_trunc, emitting the subreg mode conversion in a separate set insn. > That avoids

Re: [RS6000] Force source of fix_truncsi2 to reg

2016-08-02 Thread Segher Boessenkool
On Wed, Aug 03, 2016 at 12:02:54AM +0930, Alan Modra wrote: > So this patch isn't a particularly good solution to pr71680, but > a) force_reg for an operand that must be a reg is 100% safe, and > b) it's good to expose more combine opportunities. I'm not sure it actually does fix the PR. But the

[RS6000] Force source of fix_truncsi2 to reg

2016-08-02 Thread Alan Modra
This is a hack I tried to avoid having to poke at lra code for pr71680.. The idea of adding force_reg here was that it removes subregs from fix_trunc, emitting the subreg mode conversion in a separate set insn. That avoids the underlying lra issue, by virtue of combine merging the SF subreg with