summaryrefslogtreecommitdiffstats
path: root/contrib/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/gcc')
-rw-r--r--contrib/gcc/fold-const.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/contrib/gcc/fold-const.c b/contrib/gcc/fold-const.c
index 5db1d84..ea16eae 100644
--- a/contrib/gcc/fold-const.c
+++ b/contrib/gcc/fold-const.c
@@ -5661,6 +5661,9 @@ extract_muldiv_1 (tree t, tree c, enum tree_code code, tree wide_type,
}
break;
}
+ /* If the constant is negative, we cannot simplify this. */
+ if (tree_int_cst_sgn (c) == -1)
+ break;
/* FALLTHROUGH */
case NEGATE_EXPR:
if ((t1 = extract_muldiv (op0, c, code, wide_type, strict_overflow_p))
OpenPOWER on IntegriCloud