diff options
author | Richard Guenther <rguenther@suse.de> | 2012-05-30 12:29:26 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2012-05-30 12:29:26 +0000 |
commit | e40a96803c2deb2e9b0eb3dbc8fbcea4f3c02a30 (patch) | |
tree | 618c3869f54a501b0026e00d36d8f0bce2a3cb72 /gcc/fold-const.c | |
parent | 08cad606cd17afa03e68debc31cc6ee532b3f951 (diff) | |
download | gcc-e40a96803c2deb2e9b0eb3dbc8fbcea4f3c02a30.zip gcc-e40a96803c2deb2e9b0eb3dbc8fbcea4f3c02a30.tar.gz gcc-e40a96803c2deb2e9b0eb3dbc8fbcea4f3c02a30.tar.bz2 |
re PR tree-optimization/53501 (scev introduces signed overflow)
2012-05-30 Richard Guenther <rguenther@suse.de>
PR middle-end/53501
* fold-const.c (fold_binary_loc): Make sure to call
fold_plusminus_mult_expr with the original sign of operands.
* gcc.dg/torture/pr53501.c: New testcase.
* c-c++-common/restrict-2.c: Adjust.
From-SVN: r188009
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r-- | gcc/fold-const.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c index 8a54810..64a0d7f 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -10045,12 +10045,12 @@ fold_binary_loc (location_t loc, /* Handle (A1 * C1) + (A2 * C2) with A1, A2 or C1, C2 being the same or one. Make sure type is not saturating. fold_plusminus_mult_expr will re-associate. */ - if ((TREE_CODE (arg0) == MULT_EXPR - || TREE_CODE (arg1) == MULT_EXPR) + if ((TREE_CODE (op0) == MULT_EXPR + || TREE_CODE (op1) == MULT_EXPR) && !TYPE_SATURATING (type) && (!FLOAT_TYPE_P (type) || flag_associative_math)) { - tree tem = fold_plusminus_mult_expr (loc, code, type, arg0, arg1); + tree tem = fold_plusminus_mult_expr (loc, code, type, op0, op1); if (tem) return tem; } @@ -10668,12 +10668,12 @@ fold_binary_loc (location_t loc, /* Handle (A1 * C1) - (A2 * C2) with A1, A2 or C1, C2 being the same or one. Make sure type is not saturating. fold_plusminus_mult_expr will re-associate. */ - if ((TREE_CODE (arg0) == MULT_EXPR - || TREE_CODE (arg1) == MULT_EXPR) + if ((TREE_CODE (op0) == MULT_EXPR + || TREE_CODE (op1) == MULT_EXPR) && !TYPE_SATURATING (type) && (!FLOAT_TYPE_P (type) || flag_associative_math)) { - tree tem = fold_plusminus_mult_expr (loc, code, type, arg0, arg1); + tree tem = fold_plusminus_mult_expr (loc, code, type, op0, op1); if (tem) return tem; } |