This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH 59/89] Make gimple_goto_set_dest require a gimple_goto
- From: David Malcolm <dmalcolm at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: David Malcolm <dmalcolm at redhat dot com>
- Date: Mon, 21 Apr 2014 12:57:30 -0400
- Subject: [PATCH 59/89] Make gimple_goto_set_dest require a gimple_goto
- Authentication-results: sourceware.org; auth=none
- References: <1398099480-49147-1-git-send-email-dmalcolm at redhat dot com>
gcc/
* gimple.h (gimple_goto_set_dest): Require a gimple_goto.
* tree-cfg.c (factor_computed_gotos): Add checked cast to gimple_goto.
(cleanup_dead_labels): Likewise.
---
gcc/gimple.h | 3 +--
gcc/tree-cfg.c | 5 +++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/gcc/gimple.h b/gcc/gimple.h
index 38f4ea7..7dfd512 100644
--- a/gcc/gimple.h
+++ b/gcc/gimple.h
@@ -3509,9 +3509,8 @@ gimple_goto_dest (const_gimple gs)
/* Set DEST to be the destination of the unconditonal jump GS. */
static inline void
-gimple_goto_set_dest (gimple gs, tree dest)
+gimple_goto_set_dest (gimple_goto gs, tree dest)
{
- GIMPLE_CHECK (gs, GIMPLE_GOTO);
gimple_set_op (gs, 0, dest);
}
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c
index 9efb01c..efc3367 100644
--- a/gcc/tree-cfg.c
+++ b/gcc/tree-cfg.c
@@ -1422,10 +1422,11 @@ cleanup_dead_labels (void)
case GIMPLE_GOTO:
if (!computed_goto_p (stmt))
{
- label = gimple_goto_dest (stmt);
+ gimple_goto goto_stmt = stmt->as_a_gimple_goto ();
+ label = gimple_goto_dest (goto_stmt);
new_label = main_block_label (label);
if (new_label != label)
- gimple_goto_set_dest (stmt, new_label);
+ gimple_goto_set_dest (goto_stmt, new_label);
}
break;
--
1.8.5.3