On 12/18/23 06:42, Xi Ruoyao wrote:
With simplify_gen_unary we end up with a not fully expanded RTX like
(set (reg:SI 90) (and:SI (neg:SI (reg:SI 80)) (const_int 63)))
Then it will cause an ICE with unrecognizable insn.
gcc/ChangeLog:
PR middle-end/113033
* expmed.cc (expand_shift_1): When expanding rotate shift, call
negate_rtx instead of simplify_gen_unary (NEG, ...).
The key difference being that using negate_rtx will go through the
expander which knows how to synthesize negation whereas
simplify_gen_unary will just generate a (neg ...) and assume it matches
something in the backend, right?
If so, this patch is fine for the trunk.
jeff