2005-03-11 James A. Morrison <phython@gcc.gnu.org>
PR tree-optimization/20130
* fold-const.c (fold): Fold x * -1 into -x.
From-SVN: r96283
+2005-03-11 James A. Morrison <phython@gcc.gnu.org>
+
+ PR tree-optimization/20130
+ * fold-const.c (fold): Fold x * -1 into -x.
+
2005-03-11 Kaz Kojima <kkojima@gcc.gnu.org>
PR rtl-optimization/20331
return omit_one_operand (type, arg1, arg0);
if (integer_onep (arg1))
return non_lvalue (fold_convert (type, arg0));
+ /* Transform x * -1 into -x. */
+ if (integer_all_onesp (arg1))
+ return fold_convert (type, negate_expr (arg0));
/* (a * (1 << b)) is (a << b) */
if (TREE_CODE (arg1) == LSHIFT_EXPR
+2005-03-10 James A. Morrison <phython@gcc.gnu.org>
+
+ PR tree-optimization/20130
+ * gcc.dg/pr20130-1.c: New test.
+
2005-03-10 Steve Ellcey <sje@cup.hp.com>
PR target/20095
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-generic" } */
+int z (int a) {
+ return a * -1;
+}
+
+int x (int a) {
+ return -1 * a;
+}
+
+int y (int a) {
+ return -(-1 * -a);
+}
+/* { dg-final { scan-tree-dump-times "-a" 3 "generic" } } */