https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71724
--- Comment #5 from Segher Boessenkool <segher at gcc dot gnu.org> --- I am using the following, which also fixes the infinite loop, and seems to not regress code quality much at all (I found *one* pattern where it made things one machine insn worse, involving a define_insn_and_split (with cost 0, so any finite cost is better -- combine did manage to do something that is better according to its costs!) But I am worried something similar then needs to be done to true_rtx, and I don't see what. === diff --git a/gcc/combine.c b/gcc/combine.c index c7255f0..ecdd3fd 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -5658,7 +5658,7 @@ combine_simplify_rtx (rtx x, machine_mode op0_mode, int in here since true_rtx or false_rtx might share RTL with x as a result of the if_then_else_cond call above. */ true_rtx = subst (copy_rtx (true_rtx), pc_rtx, pc_rtx, 0, 0, 0); - false_rtx = subst (copy_rtx (false_rtx), pc_rtx, pc_rtx, 0, 0, 0); + false_rtx = subst (copy_rtx (false_rtx), cond, const0_rtx, 0, 0, 0); /* If true_rtx and false_rtx are not general_operands, an if_then_else is unlikely to be simpler. */ ===