From 3a11ec8b5344520f07a639c4bd676e1124c919cc Mon Sep 17 00:00:00 2001 From: Richard Earnshaw Date: Fri, 6 Jun 2003 17:19:06 +0000 Subject: re PR target/11052 ([arm] noce_process_if_block() can loose REG_INC notes) PR target/11052 * ifcvt.c (noce_process_if_block): Fail if the destination has side-effects. gcc.c-torture/execute/20030606-1.c: New. From-SVN: r67558 --- gcc/ifcvt.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'gcc/ifcvt.c') diff --git a/gcc/ifcvt.c b/gcc/ifcvt.c index baac041..8747906 100644 --- a/gcc/ifcvt.c +++ b/gcc/ifcvt.c @@ -1821,6 +1821,15 @@ noce_process_if_block (ce_info) || modified_between_p (x, PREV_INSN (if_info.cond_earliest), jump)) insn_b = set_b = NULL_RTX; } + + /* If x has side effects then only the if-then-else form is safe to + convert. But even in that case we would need to restore any notes + (such as REG_INC) at then end. That can be tricky if + noce_emit_move_insn expands to more than one insn, so disable the + optimization entirely for now if there are side effects. */ + if (side_effects_p (x)) + return FALSE; + b = (set_b ? SET_SRC (set_b) : x); /* Only operate on register destinations, and even then avoid extending -- cgit v1.1