aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2015-12-02 14:04:32 -0500
committerJason Merrill <jason@gcc.gnu.org>2015-12-02 14:04:32 -0500
commite9ea372d08324b38acbc7234e803f8f128c439b8 (patch)
treeb24711f3767c1466724c323f7187c923e9f49ec6 /gcc
parente9e32ee6e8df82ba1d103ec2c501ecc7c185bc2e (diff)
downloadgcc-e9ea372d08324b38acbc7234e803f8f128c439b8.zip
gcc-e9ea372d08324b38acbc7234e803f8f128c439b8.tar.gz
gcc-e9ea372d08324b38acbc7234e803f8f128c439b8.tar.bz2
* cp-gimplify.c (cp_fold): Use fold_build*.
From-SVN: r231195
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog4
-rw-r--r--gcc/cp/cp-gimplify.c18
2 files changed, 13 insertions, 9 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index ebd567a..259c312 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,7 @@
+2015-12-02 Jason Merrill <jason@redhat.com>
+
+ * cp-gimplify.c (cp_fold): Use fold_build*.
+
2015-12-02 Joseph Myers <joseph@codesourcery.com>
PR c/68162
diff --git a/gcc/cp/cp-gimplify.c b/gcc/cp/cp-gimplify.c
index 3c89f1b..86fef9e 100644
--- a/gcc/cp/cp-gimplify.c
+++ b/gcc/cp/cp-gimplify.c
@@ -1944,9 +1944,9 @@ cp_fold (tree x)
op0 = cp_fold (op0);
if (op0 != TREE_OPERAND (x, 0))
- x = build1_loc (loc, code, TREE_TYPE (x), op0);
-
- x = fold (x);
+ x = fold_build1_loc (loc, code, TREE_TYPE (x), op0);
+ else
+ x = fold (x);
/* Conversion of an out-of-range value has implementation-defined
behavior; the language considers it different from arithmetic
@@ -1976,9 +1976,9 @@ cp_fold (tree x)
op0 = cp_fold (TREE_OPERAND (x, 0));
if (op0 != TREE_OPERAND (x, 0))
- x = build1_loc (loc, code, TREE_TYPE (x), op0);
-
- x = fold (x);
+ x = fold_build1_loc (loc, code, TREE_TYPE (x), op0);
+ else
+ x = fold (x);
gcc_assert (TREE_CODE (x) != COND_EXPR
|| !VOID_TYPE_P (TREE_TYPE (TREE_OPERAND (x, 0))));
@@ -2048,9 +2048,9 @@ cp_fold (tree x)
op0 = build_empty_stmt (loc);
if (op0 != TREE_OPERAND (x, 0) || op1 != TREE_OPERAND (x, 1))
- x = build2_loc (loc, code, TREE_TYPE (x), op0, op1);
-
- x = fold (x);
+ x = fold_build2_loc (loc, code, TREE_TYPE (x), op0, op1);
+ else
+ x = fold (x);
if (TREE_CODE (x) == COMPOUND_EXPR && TREE_OPERAND (x, 0) == NULL_TREE
&& TREE_OPERAND (x, 1))