aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-ccp.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2011-01-02 18:09:08 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2011-01-02 18:09:08 +0100
commit4e9962966450ca52855f92972d87c170137247bb (patch)
tree473c86d5cf618b6ac14dff6938dcc11a75af711b /gcc/tree-ssa-ccp.c
parentbc470c243a8bbecdb92f2a7f4636f92db6fe0120 (diff)
downloadgcc-4e9962966450ca52855f92972d87c170137247bb.zip
gcc-4e9962966450ca52855f92972d87c170137247bb.tar.gz
gcc-4e9962966450ca52855f92972d87c170137247bb.tar.bz2
re PR tree-optimization/47140 (error: conversion of register to a different size)
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. From-SVN: r168402
Diffstat (limited to 'gcc/tree-ssa-ccp.c')
-rw-r--r--gcc/tree-ssa-ccp.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/tree-ssa-ccp.c b/gcc/tree-ssa-ccp.c
index aea7edf..371620e 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;