From 1a9393e06ad592b87e26b264f35cb26bb4c1afc8 Mon Sep 17 00:00:00 2001 From: aoliva Date: Mon, 16 Nov 2009 20:18:33 +0000 Subject: [PATCH] * tree-cfg.c (gimple_redirect_edge_and_branch) : Create the decl label for the new dest block on demand. Require a fallthrough edge if no asm labels were redirected. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@154213 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 6 ++++++ gcc/tree-cfg.c | 13 +++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index bcfe5a96aff..aba806ec812 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2009-11-16 Alexandre Oliva + + * tree-cfg.c (gimple_redirect_edge_and_branch) : + Create the decl label for the new dest block on demand. Require + a fallthrough edge if no asm labels were redirected. + 2009-11-16 Uros Bizjak * config/i386/i386.md (cbranchsi4): Use nonimmediate_operand for diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c index 4de3dea4ea4..b3b71b9abba 100644 --- a/gcc/tree-cfg.c +++ b/gcc/tree-cfg.c @@ -4666,14 +4666,23 @@ gimple_redirect_edge_and_branch (edge e, basic_block dest) case GIMPLE_ASM: { int i, n = gimple_asm_nlabels (stmt); - tree label = gimple_block_label (dest); + tree label = NULL; for (i = 0; i < n; ++i) { tree cons = gimple_asm_label_op (stmt, i); if (label_to_block (TREE_VALUE (cons)) == e->dest) - TREE_VALUE (cons) = label; + { + if (!label) + label = gimple_block_label (dest); + TREE_VALUE (cons) = label; + } } + + /* If we didn't find any label matching the former edge in the + asm labels, we must be redirecting the fallthrough + edge. */ + gcc_assert (label || (e->flags & EDGE_FALLTHRU)); } break; -- 2.11.4.GIT