On 4/6/23 08:21, Eric Botcazou wrote:
So, perhaps just in the return op0; case add further code for
WORD_REGISTER_OPERATIONS and sub-word modes which will call nonzero_bits
again for the word mode and decide if it is still safe.
Does it work to just replace mode by word_mode in the calls to nonzero_bits?
It helps marginally -- basically we defer mucking up the code a bit. We
then hit this in simplify_and_const_int_1:
/* See what bits may be nonzero in VAROP. Unlike the general case of
a call to nonzero_bits, here we don't care about bits outside
MODE. */
nonzero = nonzero_bits (varop, mode) & GET_MODE_MASK (mode);
That just seems wrong for WORD_REGISTER_OPERATIONS targets.
Hacking both locations in a similar manner fixes the test.
jeff