Hi Richard, > Don't we still need this code (without the REG_DEAD handling) for the > case in which… > >> + /* As we are transforming >> + if (x > y) >> + { >> + a = b; >> + c = d; >> + } >> + into >> + a = (x > y) ... >> + c = (x > y) ... >> + >> + we potentially check x > y before every set. >> + Even though the check might be removed by subsequent passes, this means >> + that we cannot transform >> + if (x > y) >> + { >> + x = y; >> + ... >> + } >> + into >> + x = (x > y) ... >> + ... >> + since this would invalidate x and the following to-be-removed checks. >> + Therefore we introduce a temporary every time we are about to >> + overwrite a variable used in the check. Costing of a sequence with >> + these is going to be inaccurate so only use temporaries when >> + needed. */ >> + if (reg_overlap_mentioned_p (target, cond)) >> + temp = gen_reg_rtx (GET_MODE (target)); > > …this code triggers? I don't see otherwise how later uses of x would > pick up “temp” instead of the original target. E.g. suppose we had: > > if (x > y) > { > x = …; > z = x; // x does not die here > } > > Without the loop, it looks like z would pick up the old value of x > (used in the comparison) instead of the new one. getting back to this now. I re-added handling of the situation you mentioned (even though I didn't manage to trigger it myself). Regards Robin