aboutsummaryrefslogtreecommitdiff
path: root/gcc/expr.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2014-11-10 14:06:56 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2014-11-10 14:06:56 +0000
commit3090fa556b469453c5dcddf6617443d26365d9d0 (patch)
treef4818fc8c8e6bf0a682024c1468df6402331438b /gcc/expr.c
parent27be769ce52a87d88ee63707fe8c0fb4fe7bfd06 (diff)
downloadgcc-3090fa556b469453c5dcddf6617443d26365d9d0.zip
gcc-3090fa556b469453c5dcddf6617443d26365d9d0.tar.gz
gcc-3090fa556b469453c5dcddf6617443d26365d9d0.tar.bz2
re PR tree-optimization/63798 (FAIL: gcc.target/powerpc/ppc-fmadd-1.c scan-assembler-not f(add|sub|mul|neg))
2014-11-10 Richard Biener <rguenther@suse.de> PR middle-end/63798 * expr.c (expand_expr_real_2): When expanding FMA_EXPRs properly treat the embedded multiplication as commutative when looking for feeding negates. From-SVN: r217287
Diffstat (limited to 'gcc/expr.c')
-rw-r--r--gcc/expr.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/expr.c b/gcc/expr.c
index 203e28f..0ef06ea 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -8621,6 +8621,19 @@ expand_expr_real_2 (sepops ops, rtx target, machine_mode tmode,
}
def0 = get_def_for_expr (treeop0, NEGATE_EXPR);
+ /* The multiplication is commutative - look at its 2nd operand
+ if the first isn't fed by a negate. */
+ if (!def0)
+ {
+ def0 = get_def_for_expr (treeop1, NEGATE_EXPR);
+ /* Swap operands if the 2nd operand is fed by a negate. */
+ if (def0)
+ {
+ tree tem = treeop0;
+ treeop0 = treeop1;
+ treeop1 = tem;
+ }
+ }
def2 = get_def_for_expr (treeop2, NEGATE_EXPR);
op0 = op2 = NULL;