https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121308
--- Comment #6 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The trunk branch has been updated by Andrew Pinski <pins...@gcc.gnu.org>: https://gcc.gnu.org/g:0340177d54d08b6375391ba164a878e6a596275e commit r16-2649-g0340177d54d08b6375391ba164a878e6a596275e Author: Andrew Pinski <quic_apin...@quicinc.com> Date: Tue Jul 29 21:49:16 2025 -0700 simplify-rtx: Add `(subreg (not a))` simplification for word_mode [PR121308] Right now in simplify_subreg, there is code to try to simplify for word_mode with the binary bitwise operators. The unary bitwise operator is not handle, this causes an odd mix match and the new self testing code that was added with r16-2614-g965564eafb721f was not expecting. The self testing code was for testing the newly added code but since there was already code that handles word_mode, we hit the mismatch but only for targets where word_mode is SImode (or smaller). This adds the code to handle `not` in a similar fashion as the other bitwise operators for word_mode. Changes since v1: * v2: add `&& SCALAR_INT_MODE_P (innermode)` to the conditional. Bootstrapped and tested on x86_64-linux-gnu. PR rtl-optimization/121308 gcc/ChangeLog: * simplify-rtx.cc (simplify_context::simplify_subreg): Handle subreg of `not` with word_mode to make it symmetric with the other bitwise operators. Signed-off-by: Andrew Pinski <quic_apin...@quicinc.com>