aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@gcc.gnu.org>2015-01-22 16:44:50 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2015-01-22 16:44:50 +0000
commitf77107e8141ed85ea5f35a9dd840e4431a27d763 (patch)
tree054d0aa2c7319dc11a30f4c8c7f94709384441d9
parent0c7990560b5c901884b0c2f5464c3240c0ee02cb (diff)
downloadgcc-f77107e8141ed85ea5f35a9dd840e4431a27d763.zip
gcc-f77107e8141ed85ea5f35a9dd840e4431a27d763.tar.gz
gcc-f77107e8141ed85ea5f35a9dd840e4431a27d763.tar.bz2
* fold-const.c (const_binop): Add early return for non-tcc_binary.
From-SVN: r220007
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/fold-const.c4
2 files changed, 9 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index aeddcb8..90b3987 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,4 +1,8 @@
-2015-01-23 Chen Gang <gang.chen.5i5j@gmail.com>
+2015-01-22 Eric Botcazou <ebotcazou@adacore.com>
+
+ * fold-const.c (const_binop): Add early return for non-tcc_binary.
+
+2015-01-22 Chen Gang <gang.chen.5i5j@gmail.com>
* toplev.c (init_local_tick): Process the failure when read
fails for random_seed.
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index 50a9877..b4301c7 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -1562,9 +1562,13 @@ const_binop (enum tree_code code, tree type, tree arg1, tree arg2)
default:;
}
+ if (TREE_CODE_CLASS (code) != tcc_binary)
+ return NULL_TREE;
+
/* Make sure type and arg0 have the same saturating flag. */
gcc_checking_assert (TYPE_SATURATING (type)
== TYPE_SATURATING (TREE_TYPE (arg1)));
+
return const_binop (code, arg1, arg2);
}