aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-cfg.c
diff options
context:
space:
mode:
authorAlexandre Oliva <aoliva@redhat.com>2009-11-16 20:18:33 +0000
committerAlexandre Oliva <aoliva@gcc.gnu.org>2009-11-16 20:18:33 +0000
commitf8981d1c08b02802f3b20a656b6a8d1fc46a6f1a (patch)
tree0ef81fd54f54010bdbafa2f630380ac7e91165cf /gcc/tree-cfg.c
parenta81f2330a313bcba17be25819ba4c3ad9ffd03c7 (diff)
downloadgcc-f8981d1c08b02802f3b20a656b6a8d1fc46a6f1a.zip
gcc-f8981d1c08b02802f3b20a656b6a8d1fc46a6f1a.tar.gz
gcc-f8981d1c08b02802f3b20a656b6a8d1fc46a6f1a.tar.bz2
tree-cfg.c (gimple_redirect_edge_and_branch): Create the decl label for the new dest block on demand.
* tree-cfg.c (gimple_redirect_edge_and_branch) <case GIMPLE_ASM>: Create the decl label for the new dest block on demand. Require a fallthrough edge if no asm labels were redirected. From-SVN: r154213
Diffstat (limited to 'gcc/tree-cfg.c')
-rw-r--r--gcc/tree-cfg.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c
index 4de3dea..b3b71b9 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;