https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112758

--- Comment #8 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to Eric Botcazou from comment #7)
> > I must say I have no idea what WORD_REGISTER_OPERATION says about the upper
> > bits of a paradoxical SUBREG if it is a MEM and load_extend_op (inner_mode)
> > is ZERO_EXTEND (zeros then?
> 
> Yes.
> 
> > Then this optimization is ok), or something else?  And what it says on REGs.
> 
> That it contains the result of the operation that was applied to the SUBREG
> as if it was applied to the entire REG, provided that
> word_register_operation_p is true.  Otherwise, it's undefined.

But if we see a REG in there, we don't really know what operation it was.
Sure, if the operation is visible, we know it, but say PLUS can be extended
either way.

Which means punt on this optimization for WORD_REGISTER_OPERATIONS if the outer
mode is word_mode, except when sub is a MEM and load_extend_op (inner_mode) ==
ZERO_EXTEND?

Reply via email to