Some code I added for the ptx backend triggered tree-checking failures
for gimple created in tree-nested: we can end up taking the address of
an SSA_NAME, which seems invalid. The problem is that code in
tree-nested wants to change the rhs of an existing assignment, but just
using gimple_assign_set_rhs1 is insufficient: the previous rhs was an
ADDR_EXPR, and that code remains afterwards.
Fixed with the following patch, tested (including Ada) on x86_64-linux. Ok?
Bernd
diff --git a/gcc/tree-nested.c b/gcc/tree-nested.c
index 5408fba..1afcf09 100644
--- a/gcc/tree-nested.c
+++ b/gcc/tree-nested.c
@@ -2738,6 +2738,7 @@ finalize_nesting_tree_1 (struct nesting_info *root)
gimple_stmt_iterator gsi = gsi_last (stmt_list);
x = init_tmp_var (root, x, &gsi);
gimple_assign_set_rhs1 (stmt, x);
+ gimple_assign_set_rhs_code (stmt, TREE_CODE (x));
}
}
}