Commit 7bef8680 by Richard Kenner

(subst, case MINUS): Canonicalize (minus A (plus A B)).

From-SVN: r6226
parent 9e269f72
...@@ -3564,6 +3564,17 @@ subst (x, from, to, in_dest, unique_copy) ...@@ -3564,6 +3564,17 @@ subst (x, from, to, in_dest, unique_copy)
- INTVAL (XEXP (XEXP (x, 1), 1)) - 1); - INTVAL (XEXP (XEXP (x, 1), 1)) - 1);
goto restart; 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; break;
case MULT: case MULT:
......
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