aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-sccvn.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree-ssa-sccvn.c')
-rw-r--r--gcc/tree-ssa-sccvn.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/tree-ssa-sccvn.c b/gcc/tree-ssa-sccvn.c
index 324cd73f513..d62a49d2d1e 100644
--- a/gcc/tree-ssa-sccvn.c
+++ b/gcc/tree-ssa-sccvn.c
@@ -60,6 +60,8 @@ along with GCC; see the file COPYING3. If not see
#include "domwalk.h"
#include "gimple-iterator.h"
#include "gimple-match.h"
+#include "stringpool.h"
+#include "attribs.h"
/* This algorithm is based on the SCC algorithm presented by Keith
Cooper and L. Taylor Simpson in "SCC-Based Value numbering"
@@ -2636,6 +2638,14 @@ vn_nary_op_eq (const_vn_nary_op_t const vno1, const_vn_nary_op_t const vno2)
if (!expressions_equal_p (vno1->op[i], vno2->op[i]))
return false;
+ /* BIT_INSERT_EXPR has an implict operand as the type precision
+ of op1. Need to check to make sure they are the same. */
+ if (vno1->opcode == BIT_INSERT_EXPR
+ && TREE_CODE (vno1->op[1]) == INTEGER_CST
+ && TYPE_PRECISION (TREE_TYPE (vno1->op[1]))
+ != TYPE_PRECISION (TREE_TYPE (vno2->op[1])))
+ return false;
+
return true;
}