On Thu, Jan 12, 2017 at 11:02:36AM -0600, Segher Boessenkool wrote:
> Thanks for the example.  ROSBG, what a weird instruction.

And it's annoying too because it does the same as RISBG in some
cases and can confuse "combine" to take a different branch that
turns out to be a dead end.

> On Thu, Jan 05, 2017 at 05:46:51PM +0100, Dominik Vogt wrote:
> > --- a/gcc/combine.c
> > +++ b/gcc/combine.c
> > @@ -11372,6 +11372,16 @@ change_zero_ext_src (subrtx_ptr_iterator *piter)
> >    else if (GET_CODE (x) == ZERO_EXTEND
> >        && SCALAR_INT_MODE_P (mode)
> >        && REG_P (XEXP (x, 0))
> > +      && !HARD_REGISTER_P (XEXP (x, 0))
> > +      && GET_MODE_PRECISION (GET_MODE (XEXP (x, 0)))
> > +         < GET_MODE_PRECISION (mode))
> > +    {
> > +      /* (zero_extract (reg)) -> (and (subreg (reg) 0) (const_int)) */
> 
> s/zero_extract/zero_extend/
> 
> >     * combine.c (change_zero_ext_src): Handle zero_extend without subreg.
> 
> "Handle zero_extend of a pseudo."?
> 
> Okay for trunk with that.  Thanks for the patch,

The patch forgot to set "size" and generated invalid Rtl because
of that.  Fixed and tested, but I'd prefer to repost my growing
stack of patches when gcc-7 is released.  There are too many
changes in "combine" and "simplify" that may depend on each other.

Ciao

Dominik ^_^  ^_^

-- 

Dominik Vogt
IBM Germany

Reply via email to