https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111863
--- Comment #11 from CVS 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:b20dbddcc41120144e700c4e3ef1ec396b1c56ab commit r14-4729-gb20dbddcc41120144e700c4e3ef1ec396b1c56ab Author: Andrew Pinski <pins...@gmail.com> Date: Wed Oct 18 10:26:07 2023 -0700 Fix expansion of `(a & 2) != 1` I had a thinko in r14-1600-ge60593f3881c72a96a3fa4844d73e8a2cd14f670 where we would remove the `& CST` part if we ended up not calling expand_single_bit_test. This fixes the problem by introducing a new variable that will be used for calling expand_single_bit_test. As afar as I know this can only show up when disabling optimization passes as this above form would have been optimized away. Committed as obvious after a bootstrap/test on x86_64-linux-gnu. PR middle-end/111863 gcc/ChangeLog: * expr.cc (do_store_flag): Don't over write arg0 when stripping off `& POW2`. gcc/testsuite/ChangeLog: * gcc.c-torture/execute/pr111863-1.c: New test.