aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-cfg.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2005-10-05 17:02:57 -0700
committerRichard Henderson <rth@gcc.gnu.org>2005-10-05 17:02:57 -0700
commitbf7e247271fe1ae00a94d1d4ba8e26db9767d5cb (patch)
tree0593d45ae4e083fc9bb38c628fa8114d59031624 /gcc/tree-cfg.c
parentc54c1b2b52cb2cc41b2b5aa88d83c16f3833428b (diff)
downloadgcc-bf7e247271fe1ae00a94d1d4ba8e26db9767d5cb.zip
gcc-bf7e247271fe1ae00a94d1d4ba8e26db9767d5cb.tar.gz
gcc-bf7e247271fe1ae00a94d1d4ba8e26db9767d5cb.tar.bz2
re PR middle-end/23714 (ICE in expand_assignment)
PR 23714 * tree-cfg.c (mark_array_ref_addressable_1): New. (mark_array_ref_addressable): New. * tree-flow.h (mark_array_ref_addressable): Declare. * tree-optimize.c (execute_cleanup_cfg_post_optimizing): Use it. From-SVN: r105022
Diffstat (limited to 'gcc/tree-cfg.c')
-rw-r--r--gcc/tree-cfg.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c
index d5d466e..74e6063 100644
--- a/gcc/tree-cfg.c
+++ b/gcc/tree-cfg.c
@@ -421,6 +421,39 @@ fold_cond_expr_cond (void)
}
}
+/* Mark the array of any remaining ARRAY_REFs as addressable. */
+
+static tree
+mark_array_ref_addressable_1 (tree *tp, int *walk_subtrees,
+ void *data ATTRIBUTE_UNUSED)
+{
+ tree t = *tp;
+
+ if (DECL_P (t) || TYPE_P (t))
+ *walk_subtrees = 0;
+ else if (TREE_CODE (t) == ARRAY_REF)
+ {
+ tree base = get_base_address (TREE_OPERAND (t, 0));
+ if (base && DECL_P (base))
+ TREE_ADDRESSABLE (base) = 1;
+ }
+
+ return NULL_TREE;
+}
+
+void
+mark_array_ref_addressable (void)
+{
+ basic_block bb;
+ block_stmt_iterator i;
+
+ FOR_EACH_BB (bb)
+ {
+ for (i = bsi_start (bb); !bsi_end_p(i); bsi_next(&i))
+ walk_tree (bsi_stmt_ptr (i), mark_array_ref_addressable_1, NULL, NULL);
+ }
+}
+
/* Join all the blocks in the flowgraph. */
static void