Commit 3a11ec8b by Richard Earnshaw Committed by Richard Earnshaw

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
parent 7dc8b126
2003-06-06 Richard Earnshaw <rearnsha@arm.com>
PR target/11052
* ifcvt.c (noce_process_if_block): Fail if the destination has
side-effects.
2003-06-06 Jason Merrill <jason@redhat.com>
* stmt.c (resolve_asm_operand_names): Rename from
......
......@@ -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
......
2003-06-06 Richard Earnshaw <rearnsha@arm.com>
gcc.c-torture/execute/20030606-1.c: New.
2003-06-06 Roger Sayle <roger@eyesopen.com>
* gcc.dg/builtins-2.c: Correct check-in of incorrect version.
......
int * foo (int *x, int b)
{
*(x++) = 55;
if (b)
*(x++) = b;
return x;
}
main()
{
int a[5];
memset (a, 1, sizeof (a));
if (foo(a, 0) - a != 1 || a[0] != 55 || a[1] != a[4])
abort();
memset (a, 1, sizeof (a));
if (foo(a, 2) - a != 2 || a[0] != 55 || a[1] != 2)
abort();
exit (0);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment