Commit bf7e2472 by Richard Henderson Committed by Richard Henderson

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
parent c54c1b2b
2005-10-05 Richard Henderson <rth@redhat.com>
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.
2005-10-05 Andrew Pinski <pinskia@physics.uc.edu>
PR middle-end/20606
......
// { dg-do compile }
// { dg-options "-O2 -fnon-call-exceptions" }
void run (void) {
float stack[1];
float *sp = stack;
try
{
float value2 = ((float) *(--sp));
float value1 = ((float) *(--sp));
*(sp++) = (value1 - value2);
}
catch (int *ex)
{
}
}
......@@ -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
......
......@@ -556,6 +556,7 @@ extern tree gimplify_build3 (block_stmt_iterator *, enum tree_code,
tree, tree, tree, tree);
extern void init_empty_tree_cfg (void);
extern void fold_cond_expr_cond (void);
extern void mark_array_ref_addressable (void);
extern void replace_uses_by (tree, tree);
extern void start_recording_case_labels (void);
extern void end_recording_case_labels (void);
......
......@@ -133,6 +133,7 @@ static void
execute_cleanup_cfg_post_optimizing (void)
{
fold_cond_expr_cond ();
mark_array_ref_addressable ();
cleanup_tree_cfg ();
cleanup_dead_labels ();
group_case_labels ();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment