tree-cfg.c (tree_verify_flow_info): Check that a nonlocal label is first in a sequence of labels.

* tree-cfg.c (tree_verify_flow_info): Check that a nonlocal
	label is first in a sequence of labels.

From-SVN: r93993
This commit is contained in:
Kazu Hirata 2005-01-20 22:39:41 +00:00 committed by Kazu Hirata
parent 35fdf04e91
commit 548414c6fb
2 changed files with 23 additions and 5 deletions

View File

@ -1,3 +1,8 @@
2005-01-20 Kazu Hirata <kazu@cs.umass.edu>
* tree-cfg.c (tree_verify_flow_info): Check that a nonlocal
label is first in a sequence of labels.
2005-01-20 Janis Johnson <janis187@us.ibm.com>
Giovanni Bajo <giovannibajo@gcc.gnu.org>

View File

@ -3595,25 +3595,38 @@ tree_verify_flow_info (void)
{
bool found_ctrl_stmt = false;
stmt = NULL_TREE;
/* Skip labels on the start of basic block. */
for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi))
{
if (TREE_CODE (bsi_stmt (bsi)) != LABEL_EXPR)
tree prev_stmt = stmt;
stmt = bsi_stmt (bsi);
if (TREE_CODE (stmt) != LABEL_EXPR)
break;
if (label_to_block (LABEL_EXPR_LABEL (bsi_stmt (bsi))) != bb)
if (prev_stmt && DECL_NONLOCAL (LABEL_EXPR_LABEL (stmt)))
{
error ("Nonlocal label %s is not first "
"in a sequence of labels in bb %d"",
IDENTIFIER_POINTER (DECL_NAME (LABEL_EXPR_LABEL (stmt))),
bb->index);
err = 1;
}
if (label_to_block (LABEL_EXPR_LABEL (stmt)) != bb)
{
tree stmt = bsi_stmt (bsi);
error ("Label %s to block does not match in bb %d\n",
IDENTIFIER_POINTER (DECL_NAME (LABEL_EXPR_LABEL (stmt))),
bb->index);
err = 1;
}
if (decl_function_context (LABEL_EXPR_LABEL (bsi_stmt (bsi)))
if (decl_function_context (LABEL_EXPR_LABEL (stmt))
!= current_function_decl)
{
tree stmt = bsi_stmt (bsi);
error ("Label %s has incorrect context in bb %d\n",
IDENTIFIER_POINTER (DECL_NAME (LABEL_EXPR_LABEL (stmt))),
bb->index);