From 7bef86801b607472d152d0cd561064965d874c22 Mon Sep 17 00:00:00 2001 From: Richard Kenner Date: Mon, 13 Dec 1993 20:58:37 -0500 Subject: [PATCH] (subst, case MINUS): Canonicalize (minus A (plus A B)). From-SVN: r6226 --- gcc/combine.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/gcc/combine.c b/gcc/combine.c index f4da033f10c..801d26c8964 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -3564,6 +3564,17 @@ subst (x, from, to, in_dest, unique_copy) - INTVAL (XEXP (XEXP (x, 1), 1)) - 1); goto restart; } + + /* Canonicalize (minus A (plus B C)) to (minus (minus A B) C) for + integers. */ + if (GET_CODE (XEXP (x, 1)) == PLUS && INTEGRAL_MODE_P (mode)) + { + x = gen_binary (MINUS, mode, + gen_binary (MINUS, mode, XEXP (x, 0), + XEXP (XEXP (x, 1), 0)), + XEXP (XEXP (x, 1), 1)); + goto restart; + } break; case MULT: