+2009-01-07 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/38751
+ * fold-const.c (extract_muldiv): Remove obsolete comment.
+ (fold_plusminus_mult_expr): Undo MINUS_EXPR
+ to PLUS_EXPR canonicalization for the canonicalization.
+
2009-01-07 Gerald Pfeifer <gerald@pfeifer.com>
* doc/install.texi (alpha*-dec-osf*): Remove note on 32-bit
expression would not overflow or that overflow is undefined for the type
in the language in question.
- We also canonicalize (X + 7) * 4 into X * 4 + 28 in the hope that either
- the machine has a multiply-accumulate insn or that this is part of an
- addressing calculation.
-
If we return a non-null expression, it is an equivalent form of the
original computation, but need not be in the original type.
else if (TREE_CODE (arg1) == INTEGER_CST)
{
arg10 = build_one_cst (type);
- arg11 = arg1;
+ /* As we canonicalize A - 2 to A + -2 get rid of that sign for
+ the purpose of this canonicalization. */
+ if (TREE_INT_CST_HIGH (arg1) == -1
+ && negate_expr_p (arg1)
+ && code == PLUS_EXPR)
+ {
+ arg11 = negate_expr (arg1);
+ code = MINUS_EXPR;
+ }
+ else
+ arg11 = arg1;
}
else
{