From c90f4a3775fcc95a25ee202ad188e64ab4bbfe01 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Tue, 17 Jun 2014 15:56:19 -0400 Subject: [PATCH 34/60] FIXME: fixes for "cfgrtl.c: Use rtx subclasses" --- gcc/cfgrtl.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/gcc/cfgrtl.c b/gcc/cfgrtl.c index 750a40b..4b0a920 100644 --- a/gcc/cfgrtl.c +++ b/gcc/cfgrtl.c @@ -245,7 +245,7 @@ delete_insn_chain (rtx start, rtx finish, bool clear_bb) /* Unchain the insns one by one. It would be quicker to delete all of these with a single unchaining, rather than one at a time, but we need to keep the NOTE's. */ - current = as_a (finish); + current = finish ? as_a (finish) : NULL; while (1) { prev = PREV_INSN (current); @@ -531,7 +531,9 @@ update_bb_for_insn_chain (rtx begin, rtx end, basic_block bb) rtx_insn *insn; end = NEXT_INSN (end); - for (insn = as_a (begin); insn != end; insn = NEXT_INSN (insn)) + for (insn = begin ? as_a (begin) : NULL; + insn != end; + insn = NEXT_INSN (insn)) if (!BARRIER_P (insn)) df_insn_change_bb (insn, bb); } @@ -1950,7 +1952,7 @@ commit_one_edge_insertion (edge e) basic_block bb; /* Pull the insns off the edge now since the edge might go away. */ - insns = as_a (e->insns.r); + insns = e->insns.r ? as_a (e->insns.r) : NULL; e->insns.r = NULL_RTX; /* Figure out where to put these insns. If the destination has @@ -4170,7 +4172,7 @@ duplicate_insn_chain (rtx from, rtx to) } insn = NEXT_INSN (last); delete_insn (last); - return as_a (insn); + return insn ? as_a (insn) : NULL; } /* Create a duplicate of the basic block BB. */ -- 1.8.5.3