aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-switch-conversion.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2009-07-03 22:09:12 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2009-07-03 22:09:12 +0000
commitfae1034ef48b598981195dc0192e882b9ce98894 (patch)
treee3367b873291ba1ab60b45a98762a593c7bf410a /gcc/tree-switch-conversion.c
parentba8978d0f01676d2cc72bb1bac2d3bc54d8cf2e0 (diff)
downloadgcc-fae1034ef48b598981195dc0192e882b9ce98894.zip
gcc-fae1034ef48b598981195dc0192e882b9ce98894.tar.gz
gcc-fae1034ef48b598981195dc0192e882b9ce98894.tar.bz2
re PR tree-optimization/40640 (ICE in set_value_range, at tree-vrp.c:383)
2009-07-03 Richard Guenther <rguenther@suse.de> PR tree-optimization/40640 * tree-switch-conversion.c (build_arrays): Perform arithmetic in original type. * gcc.c-torture/compile/pr40640.c: New testcase. From-SVN: r149211
Diffstat (limited to 'gcc/tree-switch-conversion.c')
-rw-r--r--gcc/tree-switch-conversion.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/tree-switch-conversion.c b/gcc/tree-switch-conversion.c
index 292c49c..2e6808b 100644
--- a/gcc/tree-switch-conversion.c
+++ b/gcc/tree-switch-conversion.c
@@ -556,13 +556,13 @@ build_arrays (gimple swtch)
gsi = gsi_for_stmt (swtch);
arr_index_type = build_index_type (info.range_size);
- tmp = create_tmp_var (arr_index_type, "csti");
+ tmp = create_tmp_var (TREE_TYPE (info.index_expr), "csti");
add_referenced_var (tmp);
tidx = make_ssa_name (tmp, NULL);
sub = fold_build2 (MINUS_EXPR, TREE_TYPE (info.index_expr), info.index_expr,
fold_convert (TREE_TYPE (info.index_expr),
info.range_min));
- sub = force_gimple_operand_gsi (&gsi, fold_convert (arr_index_type, sub),
+ sub = force_gimple_operand_gsi (&gsi, sub,
false, NULL, true, GSI_SAME_STMT);
stmt = gimple_build_assign (tidx, sub);
SSA_NAME_DEF_STMT (tidx) = stmt;