Commit 77568960 by Andrew Pinski Committed by Andrew Pinski

re PR middle-end/15014 (labels after are removed even though they are used)

2004-10-18  Andrew Pinski  <pinskia@physics.uc.edu>

        PR middle-end/15014
        PR middle-end/16973
        * tree-cfg.c (remove_bb): If we have a label expression in the
        basic block and the label we have taken the address, move the
        label expression to the basic block which is previous in the
        linked list.
        (tree_verify_flow_info): Fix printing out the label name of the
        problematic label expression.

From-SVN: r89237
parent b1c79b46
2004-10-18 Andrew Pinski <pinskia@physics.uc.edu>
PR middle-end/15014
PR middle-end/16973
* tree-cfg.c (remove_bb): If we have a label expression in the
basic block and the label we have taken the address, move the
label expression to the basic block which is previous in the
linked list.
(tree_verify_flow_info): Fix printing out the label name of the
problematic label expression.
2004-10-18 Pat Haugen <pthaugen@us.ibm.com> 2004-10-18 Pat Haugen <pthaugen@us.ibm.com>
PR rtl-optimization/18002 PR rtl-optimization/18002
......
...@@ -1810,12 +1810,25 @@ remove_bb (basic_block bb) ...@@ -1810,12 +1810,25 @@ remove_bb (basic_block bb)
} }
/* Remove all the instructions in the block. */ /* Remove all the instructions in the block. */
for (i = bsi_start (bb); !bsi_end_p (i); bsi_remove (&i)) for (i = bsi_start (bb); !bsi_end_p (i);)
{ {
tree stmt = bsi_stmt (i); tree stmt = bsi_stmt (i);
if (TREE_CODE (stmt) == LABEL_EXPR
&& FORCED_LABEL (LABEL_EXPR_LABEL (stmt)))
{
basic_block new_bb = bb->prev_bb;
block_stmt_iterator new_bsi = bsi_after_labels (new_bb);
bsi_remove (&i);
bsi_insert_after (&new_bsi, stmt, BSI_NEW_STMT);
}
else
{
release_defs (stmt); release_defs (stmt);
set_bb_for_stmt (stmt, NULL); set_bb_for_stmt (stmt, NULL);
bsi_remove (&i);
}
/* Don't warn for removed gotos. Gotos are often removed due to /* Don't warn for removed gotos. Gotos are often removed due to
jump threading, thus resulting in bogus warnings. Not great, jump threading, thus resulting in bogus warnings. Not great,
...@@ -3403,8 +3416,9 @@ tree_verify_flow_info (void) ...@@ -3403,8 +3416,9 @@ tree_verify_flow_info (void)
if (label_to_block (LABEL_EXPR_LABEL (bsi_stmt (bsi))) != bb) if (label_to_block (LABEL_EXPR_LABEL (bsi_stmt (bsi))) != bb)
{ {
tree stmt = bsi_stmt (bsi);
error ("Label %s to block does not match in bb %d\n", error ("Label %s to block does not match in bb %d\n",
IDENTIFIER_POINTER (DECL_NAME (bsi_stmt (bsi))), IDENTIFIER_POINTER (DECL_NAME (LABEL_EXPR_LABEL (stmt))),
bb->index); bb->index);
err = 1; err = 1;
} }
...@@ -3412,8 +3426,9 @@ tree_verify_flow_info (void) ...@@ -3412,8 +3426,9 @@ tree_verify_flow_info (void)
if (decl_function_context (LABEL_EXPR_LABEL (bsi_stmt (bsi))) if (decl_function_context (LABEL_EXPR_LABEL (bsi_stmt (bsi)))
!= current_function_decl) != current_function_decl)
{ {
tree stmt = bsi_stmt (bsi);
error ("Label %s has incorrect context in bb %d\n", error ("Label %s has incorrect context in bb %d\n",
IDENTIFIER_POINTER (DECL_NAME (bsi_stmt (bsi))), IDENTIFIER_POINTER (DECL_NAME (LABEL_EXPR_LABEL (stmt))),
bb->index); bb->index);
err = 1; err = 1;
} }
......
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