aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-switch-conversion.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2009-04-22 11:30:04 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2009-04-22 11:30:04 +0000
commit9925bce0b85fd64eb1aa4afac20552781ecfa5e2 (patch)
tree5b22e59c1c76f93596d651c3685b5a93299c6e44 /gcc/tree-switch-conversion.c
parentce30eccb0612505eb75a1046db11b7a4c0bb0326 (diff)
downloadgcc-9925bce0b85fd64eb1aa4afac20552781ecfa5e2.zip
gcc-9925bce0b85fd64eb1aa4afac20552781ecfa5e2.tar.gz
gcc-9925bce0b85fd64eb1aa4afac20552781ecfa5e2.tar.bz2
re PR tree-optimization/39845 (ICE: in make_decl_rtl, at varasm.c:1304)
2009-04-22 Richard Guenther <rguenther@suse.de> PR tree-optimization/39845 * tree-switch-conversion.c (build_arrays): Add new referenced vars. (gen_inbound_check): Likewise. * gcc.c-torture/compile/pr39845.c: New testcase. From-SVN: r146569
Diffstat (limited to 'gcc/tree-switch-conversion.c')
-rw-r--r--gcc/tree-switch-conversion.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/tree-switch-conversion.c b/gcc/tree-switch-conversion.c
index eade177..6f0343f 100644
--- a/gcc/tree-switch-conversion.c
+++ b/gcc/tree-switch-conversion.c
@@ -547,7 +547,7 @@ static void
build_arrays (gimple swtch)
{
tree arr_index_type;
- tree tidx, sub;
+ tree tidx, sub, tmp;
gimple stmt;
gimple_stmt_iterator gsi;
int i;
@@ -555,7 +555,9 @@ build_arrays (gimple swtch)
gsi = gsi_for_stmt (swtch);
arr_index_type = build_index_type (info.range_size);
- tidx = make_ssa_name (create_tmp_var (arr_index_type, "csti"), NULL);
+ tmp = create_tmp_var (arr_index_type, "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));
@@ -694,6 +696,7 @@ gen_inbound_check (gimple swtch)
/* (end of) block 0 */
gsi = gsi_for_stmt (info.arr_ref_first);
tmp_u_var = create_tmp_var (utype, "csui");
+ add_referenced_var (tmp_u_var);
tmp_u_1 = make_ssa_name (tmp_u_var, NULL);
cast = fold_convert (utype, info.index_expr);