diff options
author | Andrew Pinski <apinski@cavium.com> | 2017-07-21 17:16:51 +0000 |
---|---|---|
committer | Andrew Pinski <pinskia@gcc.gnu.org> | 2017-07-21 10:16:51 -0700 |
commit | 27ecd5c2b0dd74f6721e94972751855952acefd1 (patch) | |
tree | 7c3fb8cf61026ef9d76355f5674c64fc00a88130 /gcc/fold-const.c | |
parent | 8c7331c5563e00e63837d0246f1325371157d46a (diff) | |
download | gcc-27ecd5c2b0dd74f6721e94972751855952acefd1.zip gcc-27ecd5c2b0dd74f6721e94972751855952acefd1.tar.gz gcc-27ecd5c2b0dd74f6721e94972751855952acefd1.tar.bz2 |
tree-ssa-sccvn.c (vn_nary_op_eq): Check BIT_INSERT_EXPR's operand 1 to see if the types precision matches.
2017-07-21 Andrew Pinski <apinski@cavium.com>
* tree-ssa-sccvn.c (vn_nary_op_eq): Check BIT_INSERT_EXPR's
operand 1 to see if the types precision matches.
* fold-const.c (operand_equal_p): Likewise.
From-SVN: r250431
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r-- | gcc/fold-const.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c index d702de2..c061f3e 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -3184,9 +3184,18 @@ operand_equal_p (const_tree arg0, const_tree arg1, unsigned int flags) flags &= ~OEP_ADDRESS_OF; return OP_SAME (0); + case BIT_INSERT_EXPR: + /* BIT_INSERT_EXPR has an implict operand as the type precision + of op1. Need to check to make sure they are the same. */ + if (TREE_CODE (TREE_OPERAND (arg0, 1)) == INTEGER_CST + && TREE_CODE (TREE_OPERAND (arg1, 1)) == INTEGER_CST + && TYPE_PRECISION (TREE_TYPE (TREE_OPERAND (arg0, 1))) + != TYPE_PRECISION (TREE_TYPE (TREE_OPERAND (arg1, 1)))) + return false; + /* FALLTHRU */ + case VEC_COND_EXPR: case DOT_PROD_EXPR: - case BIT_INSERT_EXPR: return OP_SAME (0) && OP_SAME (1) && OP_SAME (2); case MODIFY_EXPR: |