aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-sccvn.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2009-05-15 13:09:53 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2009-05-15 13:09:53 +0000
commit828552ed0b8aff5e46770b4c32a7608b04ee3788 (patch)
treef22e80535ee47a66c5898bcd81363b613840d2c2 /gcc/tree-ssa-sccvn.c
parent248fc9f328f5f1c4d94052c073bdc7699cacb382 (diff)
downloadgcc-828552ed0b8aff5e46770b4c32a7608b04ee3788.zip
gcc-828552ed0b8aff5e46770b4c32a7608b04ee3788.tar.gz
gcc-828552ed0b8aff5e46770b4c32a7608b04ee3788.tar.bz2
re PR tree-optimization/39999 (gcc 4.4.0 compiles in infinite loop)
2009-05-15 Richard Guenther <rguenther@suse.de> PR tree-optimization/39999 * gimple.h (gimple_expr_type): Use the expression type looking through useless conversions. * tree-ssa-sccvn.c (vn_nary_op_lookup_stmt): Use gimple_expr_type. (vn_nary_op_insert_stmt): Likewise. (simplify_binary_expression): Likewise. * gcc.c-torture/compile/pr39999.c: New testcase. From-SVN: r147573
Diffstat (limited to 'gcc/tree-ssa-sccvn.c')
-rw-r--r--gcc/tree-ssa-sccvn.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gcc/tree-ssa-sccvn.c b/gcc/tree-ssa-sccvn.c
index 539afd2..e64b7ee 100644
--- a/gcc/tree-ssa-sccvn.c
+++ b/gcc/tree-ssa-sccvn.c
@@ -1232,7 +1232,7 @@ vn_nary_op_lookup_stmt (gimple stmt, vn_nary_op_t *vnresult)
*vnresult = NULL;
vno1.opcode = gimple_assign_rhs_code (stmt);
vno1.length = gimple_num_ops (stmt) - 1;
- vno1.type = TREE_TYPE (gimple_assign_lhs (stmt));
+ vno1.type = gimple_expr_type (stmt);
for (i = 0; i < vno1.length; ++i)
vno1.op[i] = gimple_op (stmt, i + 1);
if (vno1.opcode == REALPART_EXPR
@@ -1340,7 +1340,7 @@ vn_nary_op_insert_stmt (gimple stmt, tree result)
vno1->value_id = VN_INFO (result)->value_id;
vno1->opcode = gimple_assign_rhs_code (stmt);
vno1->length = length;
- vno1->type = TREE_TYPE (gimple_assign_lhs (stmt));
+ vno1->type = gimple_expr_type (stmt);
for (i = 0; i < vno1->length; ++i)
vno1->op[i] = gimple_op (stmt, i + 1);
if (vno1->opcode == REALPART_EXPR
@@ -2065,7 +2065,7 @@ simplify_binary_expression (gimple stmt)
fold_defer_overflow_warnings ();
result = fold_binary (gimple_assign_rhs_code (stmt),
- TREE_TYPE (gimple_get_lhs (stmt)), op0, op1);
+ gimple_expr_type (stmt), op0, op1);
if (result)
STRIP_USELESS_TYPE_CONVERSION (result);