aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vect-loop.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree-vect-loop.cc')
-rw-r--r--gcc/tree-vect-loop.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/tree-vect-loop.cc b/gcc/tree-vect-loop.cc
index c5b2799..1bdad0f 100644
--- a/gcc/tree-vect-loop.cc
+++ b/gcc/tree-vect-loop.cc
@@ -4116,6 +4116,13 @@ pop:
if (op.ops[1] == op.ops[opi])
neg = ! neg;
}
+ else if (op.code == IFN_COND_SUB)
+ {
+ op.code = IFN_COND_ADD;
+ /* Track whether we negate the reduction value each iteration. */
+ if (op.ops[2] == op.ops[opi])
+ neg = ! neg;
+ }
if (CONVERT_EXPR_CODE_P (op.code)
&& tree_nop_conversion_p (op.type, TREE_TYPE (op.ops[0])))
;