summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2015-04-16 12:10:34 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2015-04-16 12:10:34 +0000
commitc0a4b66418c45a078f7d87f45d5ccb31458d8c76 (patch)
tree70de4b20a0fdee7312802b5f5b06dabe96b52651
parentf9e88e0c9c2424df726c488905b1884061c41d01 (diff)
downloadgcc-c0a4b66418c45a078f7d87f45d5ccb31458d8c76.tar.gz
2015-04-16 Richard Biener <rguenther@suse.de>
PR tree-optimization/65774 * tree-ssa-ccp.c (evaluate_stmt): Constrain types we invoke bit-value tracking on. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@222147 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/tree-ssa-ccp.c45
2 files changed, 25 insertions, 26 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index c4d0c150736..39a73a0e872 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,11 @@
2015-04-16 Richard Biener <rguenther@suse.de>
+ PR tree-optimization/65774
+ * tree-ssa-ccp.c (evaluate_stmt): Constrain types we invoke
+ bit-value tracking on.
+
+2015-04-16 Richard Biener <rguenther@suse.de>
+
PR tree-optimization/64277
* tree-vrp.c (check_array_ref): Fix anti-range handling,
simplify upper bound handling.
diff --git a/gcc/tree-ssa-ccp.c b/gcc/tree-ssa-ccp.c
index 996296b4e36..79f6afbed98 100644
--- a/gcc/tree-ssa-ccp.c
+++ b/gcc/tree-ssa-ccp.c
@@ -1772,35 +1772,28 @@ evaluate_stmt (gimple stmt)
{
enum tree_code subcode = gimple_assign_rhs_code (stmt);
tree rhs1 = gimple_assign_rhs1 (stmt);
- switch (get_gimple_rhs_class (subcode))
- {
- case GIMPLE_SINGLE_RHS:
- if (INTEGRAL_TYPE_P (TREE_TYPE (rhs1))
- || POINTER_TYPE_P (TREE_TYPE (rhs1)))
- val = get_value_for_expr (rhs1, true);
- break;
+ tree lhs = gimple_assign_lhs (stmt);
+ if ((INTEGRAL_TYPE_P (TREE_TYPE (lhs))
+ || POINTER_TYPE_P (TREE_TYPE (lhs)))
+ && (INTEGRAL_TYPE_P (TREE_TYPE (rhs1))
+ || POINTER_TYPE_P (TREE_TYPE (rhs1))))
+ switch (get_gimple_rhs_class (subcode))
+ {
+ case GIMPLE_SINGLE_RHS:
+ val = get_value_for_expr (rhs1, true);
+ break;
- case GIMPLE_UNARY_RHS:
- if ((INTEGRAL_TYPE_P (TREE_TYPE (rhs1))
- || POINTER_TYPE_P (TREE_TYPE (rhs1)))
- && (INTEGRAL_TYPE_P (gimple_expr_type (stmt))
- || POINTER_TYPE_P (gimple_expr_type (stmt))))
- val = bit_value_unop (subcode, gimple_expr_type (stmt), rhs1);
- break;
+ case GIMPLE_UNARY_RHS:
+ val = bit_value_unop (subcode, TREE_TYPE (lhs), rhs1);
+ break;
- case GIMPLE_BINARY_RHS:
- if (INTEGRAL_TYPE_P (TREE_TYPE (rhs1))
- || POINTER_TYPE_P (TREE_TYPE (rhs1)))
- {
- tree lhs = gimple_assign_lhs (stmt);
- tree rhs2 = gimple_assign_rhs2 (stmt);
- val = bit_value_binop (subcode,
- TREE_TYPE (lhs), rhs1, rhs2);
- }
- break;
+ case GIMPLE_BINARY_RHS:
+ val = bit_value_binop (subcode, TREE_TYPE (lhs), rhs1,
+ gimple_assign_rhs2 (stmt));
+ break;
- default:;
- }
+ default:;
+ }
}
else if (code == GIMPLE_COND)
{