From 4942b76bf647d2df3dcd9fcadc6fc752ee752028 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Tue, 12 Jan 2010 10:45:19 +0100 Subject: re PR debug/42662 (invalid rtl sharing found in the insn) PR debug/42662 * simplify-rtx.c (simplify_relational_operation_1): Avoid invalid rtx sharing when canonicalizing ({lt,ge}u (plus a b) b). * gcc.dg/pr42662.c: New test. From-SVN: r155831 --- gcc/simplify-rtx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'gcc/simplify-rtx.c') diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c index 5e384d4..7c79afb 100644 --- a/gcc/simplify-rtx.c +++ b/gcc/simplify-rtx.c @@ -4046,7 +4046,8 @@ simplify_relational_operation_1 (enum rtx_code code, enum machine_mode mode, && rtx_equal_p (op1, XEXP (op0, 1)) /* Don't recurse "infinitely" for (LTU/GEU (PLUS b b) b). */ && !rtx_equal_p (op1, XEXP (op0, 0))) - return simplify_gen_relational (code, mode, cmp_mode, op0, XEXP (op0, 0)); + return simplify_gen_relational (code, mode, cmp_mode, op0, + copy_rtx (XEXP (op0, 0))); if (op1 == const0_rtx) { -- cgit v1.1