From cf369845fd042cc7bd25cb8b824857af6f22f446 Mon Sep 17 00:00:00 2001 From: Hans-Peter Nilsson Date: Mon, 10 Sep 2007 07:30:16 +0000 Subject: [PATCH] simplify-rtx.c (simplify_relational_operation_1): For recent canonicalization, don't recurse if op1 equals both PLUS arguments. * simplify-rtx.c (simplify_relational_operation_1): For recent canonicalization, don't recurse if op1 equals both PLUS arguments. From-SVN: r128323 --- gcc/ChangeLog | 5 +++++ gcc/simplify-rtx.c | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 0a493c19e41..a16c4140c16 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2007-09-10 Hans-Peter Nilsson + + * simplify-rtx.c (simplify_relational_operation_1): For recent + canonicalization, don't recurse if op1 equals both PLUS arguments. + 2007-09-09 David Daney * optabs.c (expand_sync_operation): Use plus insn if minus diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c index 02f9e2b4c36..329a0ff3839 100644 --- a/gcc/simplify-rtx.c +++ b/gcc/simplify-rtx.c @@ -3816,7 +3816,9 @@ simplify_relational_operation_1 (enum rtx_code code, enum machine_mode mode, /* Canonicalize (LTU/GEU (PLUS a b) b) as (LTU/GEU (PLUS a b) a). */ if ((code == LTU || code == GEU) && GET_CODE (op0) == PLUS - && rtx_equal_p (op1, XEXP (op0, 1))) + && 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)); if (op1 == const0_rtx) -- 2.30.2