https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109919
--- Comment #3 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:ee0f1f2294baaecfa0c038fe7e8361949d1ebd68 commit r14-1020-gee0f1f2294baaecfa0c038fe7e8361949d1ebd68 Author: Andrew Pinski <apin...@marvell.com> Date: Sat May 20 21:14:23 2023 +0000 Fix PR 109919: ICE in emit_move_insn with some bit tests The problem is I used expand_expr with the target but we don't want to use the target here as it is the wrong mode for the original expression. The testcase would ICE deap down while trying to do a move to use the target. Anyways just calling expand_expr with NULL_EXPR fixes the issue. Committed as obvious after a bootstrap/test on x86_64-linux-gnu. PR middle-end/109919 gcc/ChangeLog: * expr.cc (expand_single_bit_test): Don't use the target for expand_expr. gcc/testsuite/ChangeLog: * gcc.c-torture/compile/pr109919-1.c: New test.