https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69291
--- Comment #10 from Richard Biener <rguenth at gcc dot gnu.org> --- Testing Index: gcc/ifcvt.c =================================================================== --- gcc/ifcvt.c (revision 233262) +++ gcc/ifcvt.c (working copy) @@ -1381,10 +1381,11 @@ noce_try_store_flag_constants (struct no /* If we have x := test ? x + 3 : x + 4 then move the original x out of the way while we store flags. */ - if (common && rtx_equal_p (common, if_info->x)) + if (common && reg_mentioned_p (if_info->x, common)) { - common = gen_reg_rtx (mode); - noce_emit_move_insn (common, if_info->x); + rtx tem = gen_reg_rtx (mode); + noce_emit_move_insn (tem, common); + common = tem; } target = noce_emit_store_flag (if_info, if_info->x, reversep, normalize);