diff --git a/gcc/ChangeLog b/gcc/ChangeLog index dafb983ebb2..fdc4d58430c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2001-08-08 Bernd Schmidt + + * cselib.c (cselib_record_sets): If insn is predicated, turn + sources into IF_THEN_ELSEs. + 2001-08-08 Graham Stott * final.c (shorten_branches): Update the INSN_ADDRESSES of insns diff --git a/gcc/cselib.c b/gcc/cselib.c index 6497de0bbc7..13117668006 100644 --- a/gcc/cselib.c +++ b/gcc/cselib.c @@ -1179,8 +1179,15 @@ cselib_record_sets (insn) int i; struct set sets[MAX_SETS]; rtx body = PATTERN (insn); + rtx cond = 0; body = PATTERN (insn); + if (GET_CODE (body) == COND_EXEC) + { + cond = COND_EXEC_TEST (body); + body = COND_EXEC_CODE (body); + } + /* Find all sets. */ if (GET_CODE (body) == SET) { @@ -1219,6 +1226,9 @@ cselib_record_sets (insn) /* We don't know how to record anything but REG or MEM. */ if (GET_CODE (dest) == REG || GET_CODE (dest) == MEM) { + rtx src = sets[i].src; + if (cond) + src = gen_rtx_IF_THEN_ELSE (GET_MODE (src), cond, src, dest); sets[i].src_elt = cselib_lookup (sets[i].src, GET_MODE (dest), 1); if (GET_CODE (dest) == MEM) sets[i].dest_addr_elt = cselib_lookup (XEXP (dest, 0), Pmode, 1);