summaryrefslogtreecommitdiff
path: root/gcc/tree-cfg.c
diff options
context:
space:
mode:
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2005-08-05 23:01:54 +0000
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2005-08-05 23:01:54 +0000
commit2fc7d87c5097c0000140c29cac899e87215a08c1 (patch)
treead686c8439d31d25ef09c4a852f5a872604eaa5e /gcc/tree-cfg.c
parentaee7f4507ec142109cdfeb105bf3ce9f842633b0 (diff)
downloadgcc-2fc7d87c5097c0000140c29cac899e87215a08c1.tar.gz
PR 21728
* tree-cfg.c (remove_bb): Transmute DECL_NONLOCAL labels into FORCED_LABEL labels. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@102786 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-cfg.c')
-rw-r--r--gcc/tree-cfg.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c
index b5a0696ddec..70dca21bc83 100644
--- a/gcc/tree-cfg.c
+++ b/gcc/tree-cfg.c
@@ -1983,11 +1983,23 @@ remove_bb (basic_block bb)
{
tree stmt = bsi_stmt (i);
if (TREE_CODE (stmt) == LABEL_EXPR
- && FORCED_LABEL (LABEL_EXPR_LABEL (stmt)))
+ && (FORCED_LABEL (LABEL_EXPR_LABEL (stmt))
+ || DECL_NONLOCAL (LABEL_EXPR_LABEL (stmt))))
{
- basic_block new_bb = bb->prev_bb;
- block_stmt_iterator new_bsi = bsi_start (new_bb);
+ basic_block new_bb;
+ block_stmt_iterator new_bsi;
+
+ /* A non-reachable non-local label may still be referenced.
+ But it no longer needs to carry the extra semantics of
+ non-locality. */
+ if (DECL_NONLOCAL (LABEL_EXPR_LABEL (stmt)))
+ {
+ DECL_NONLOCAL (LABEL_EXPR_LABEL (stmt)) = 0;
+ FORCED_LABEL (LABEL_EXPR_LABEL (stmt)) = 1;
+ }
+ new_bb = bb->prev_bb;
+ new_bsi = bsi_start (new_bb);
bsi_remove (&i);
bsi_insert_before (&new_bsi, stmt, BSI_NEW_STMT);
}