@@ -1,5 +1,15 @@
2014-10-24 David Malcolm <dmalcolm@redhat.com>
+ Make gimple_goto_set_dest require a gimple_goto
+
+ * 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.
+
+2014-10-24 David Malcolm <dmalcolm@redhat.com>
+
Make gimple_label_set_label require a gimple_label
* gimple.h (gimple_label_set_label): Require a gimple_label.
@@ -3237,9 +3237,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);
}
@@ -1466,10 +1466,11 @@ cleanup_dead_labels (void)
case GIMPLE_GOTO:
if (!computed_goto_p (stmt))
{
- label = gimple_goto_dest (stmt);
+ gimple_goto goto_stmt = as_a <gimple_goto> (stmt);
+ 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;
This corresponds to: [PATCH 59/89] Make gimple_goto_set_dest require a gimple_goto https://gcc.gnu.org/ml/gcc-patches/2014-04/msg01193.html from the original 89-patch kit That earlier patch was approved by Jeff: > OK once prerequisites have gone in. in https://gcc.gnu.org/ml/gcc-patches/2014-05/msg00815.html 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/ChangeLog.gimple-classes | 10 ++++++++++ gcc/gimple.h | 3 +-- gcc/tree-cfg.c | 5 +++-- 3 files changed, 14 insertions(+), 4 deletions(-)