diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-01-02 17:09:08 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-01-02 17:09:08 +0000 |
commit | e47d81e03566e484f98e50ba946a6d8675ac6a77 (patch) | |
tree | 473c86d5cf618b6ac14dff6938dcc11a75af711b /gcc/tree-ssa-ccp.c | |
parent | 4547eca67f102b9a7705a3e6259f48d993f79b7a (diff) | |
download | gcc-e47d81e03566e484f98e50ba946a6d8675ac6a77.tar.gz |
PR tree-optimization/47140
* tree-ssa-ccp.c (evaluate_stmt): For binary assignments, use
TREE_TYPE (lhs) instead of TREE_TYPE (rhs1) as second argument
to bit_value_binop.
* gcc.c-torture/compile/pr47140.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@168402 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-ccp.c')
-rw-r--r-- | gcc/tree-ssa-ccp.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/tree-ssa-ccp.c b/gcc/tree-ssa-ccp.c index aea7edfb6f8..371620e1b4f 100644 --- a/gcc/tree-ssa-ccp.c +++ b/gcc/tree-ssa-ccp.c @@ -2156,9 +2156,10 @@ evaluate_stmt (gimple stmt) 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 (rhs1), rhs1, rhs2); + TREE_TYPE (lhs), rhs1, rhs2); } break; |