> I can use canonicalize_comparison like s390 to remove the subreg, however > the question then becomes about how to avoid this in general. We cannot > allow a zero_extend to become a paradoxical subreg and then have the subreg > discarded. Most of our instructions are vector instructions which will > change the remainder of the register. > > I have defined WORD_REGISTER_OPERATIONS and CANNOT_CHANGE_MODE_CLASS(from, > to, class) and set it to true if GET_MODE_SIZE (from) < GET_MODE_SIZE (to) > but it didn't help. > > Any suggestions for a generic solution?
What kind of generic solution? Eliminating paradoxical subregs altogether? That's very likely not doable if you define WORD_REGISTER_OPERATIONS anyway. You need to pinpoint where things start to go wrong, for example in combine. -- Eric Botcazou