/* Control flow graph manipulation code for GNU compiler.
Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+ 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
Free Software Foundation, Inc.
This file is part of GCC.
#include "coretypes.h"
#include "tm.h"
#include "tree.h"
-#include "rtl.h"
#include "hard-reg-set.h"
#include "basic-block.h"
#include "regs.h"
#include "output.h"
#include "function.h"
#include "except.h"
-#include "toplev.h"
+#include "rtl-error.h"
#include "tm_p.h"
#include "obstack.h"
#include "insn-attr.h"
{
{
RTL_PASS,
- NULL, /* name */
+ "*free_cfg", /* name */
NULL, /* gate */
rest_of_pass_free_cfg, /* execute */
NULL, /* sub */
}
/* Update BLOCK_FOR_INSN of insns between BEGIN and END
- (or BARRIER if found) and notify df of the bb change.
+ (or BARRIER if found) and notify df of the bb change.
The insn chain range is inclusive
(i.e. both BEGIN and END will be updated. */
&& !find_reg_note (insn, REG_LABEL_TARGET, new_label))
add_reg_note (insn, REG_LABEL_TARGET, new_label);
}
+ while ((note = find_reg_note (insn, REG_LABEL_OPERAND, old_label))
+ != NULL_RTX)
+ XEXP (note, 0) = new_label;
}
else
{
if (abnormal_edge_flags)
make_edge (src, target, abnormal_edge_flags);
- df_mark_solutions_dirty ();
+ df_mark_solutions_dirty ();
return new_bb;
}
gcc_assert (redirected);
}
else
- redirect_edge_succ (edge_in, bb);
+ {
+ if (edge_in->src != ENTRY_BLOCK_PTR)
+ {
+ /* For asm goto even splitting of fallthru edge might
+ need insn patching, as other labels might point to the
+ old label. */
+ rtx last = BB_END (edge_in->src);
+ if (last
+ && JUMP_P (last)
+ && edge_in->dest != EXIT_BLOCK_PTR
+ && extract_asm_operands (PATTERN (last)) != NULL_RTX
+ && patch_jump_insn (last, before, bb))
+ df_set_bb_dirty (edge_in->src);
+ }
+ redirect_edge_succ (edge_in, bb);
+ }
return bb;
}
&& targetm.have_named_sections
&& e->src != ENTRY_BLOCK_PTR
&& BB_PARTITION (e->src) == BB_COLD_PARTITION
- && !(e->flags & EDGE_CROSSING))
- {
- rtx bb_note, cur_insn;
-
- bb_note = NULL_RTX;
- for (cur_insn = BB_HEAD (bb); cur_insn != NEXT_INSN (BB_END (bb));
- cur_insn = NEXT_INSN (cur_insn))
- if (NOTE_INSN_BASIC_BLOCK_P (cur_insn))
- {
- bb_note = cur_insn;
- break;
- }
-
- if (JUMP_P (BB_END (bb))
- && !any_condjump_p (BB_END (bb))
- && (single_succ_edge (bb)->flags & EDGE_CROSSING))
- add_reg_note (BB_END (bb), REG_CROSSING_JUMP, NULL_RTX);
- }
+ && !(e->flags & EDGE_CROSSING)
+ && JUMP_P (after)
+ && !any_condjump_p (after)
+ && (single_succ_edge (bb)->flags & EDGE_CROSSING))
+ add_reg_note (after, REG_CROSSING_JUMP, NULL_RTX);
}
}
s_indent = (char *) alloca ((size_t) indent + 1);
memset (s_indent, ' ', (size_t) indent);
s_indent[indent] = '\0';
-
+
if (df)
{
df_dump_top (bb, outf);
{
edge e;
edge_iterator ei;
-
+
fprintf (outf, ";; Start of basic block (");
FOR_EACH_EDGE (e, ei, bb->preds)
fprintf (outf, " %d", e->src->index);
op0 = force_operand (op0, NULL_RTX);
op1 = force_operand (op1, NULL_RTX);
do_compare_rtx_and_jump (op0, op1, comp, 0,
- mode, NULL_RTX, NULL_RTX, label);
+ mode, NULL_RTX, NULL_RTX, label, -1);
jump = get_last_insn ();
JUMP_LABEL (jump) = label;
LABEL_NUSES (label)++;
init_rtl_bb_info (basic_block bb)
{
gcc_assert (!bb->il.rtl);
- bb->il.rtl = GGC_CNEW (struct rtl_bb_info);
+ bb->il.rtl = ggc_alloc_cleared_rtl_bb_info ();
}
&& (!single_succ_p (bb)
|| single_succ_edge (bb)->flags & EDGE_ABNORMAL))
{
- /* Keeping in mind SMALL_REGISTER_CLASSES and parameters in registers,
- we search backward and place the instructions before the first
- parameter is loaded. Do this for everyone for consistency and a
- presumption that we'll get better code elsewhere as well. */
+ /* Keeping in mind targets with small register classes and parameters
+ in registers, we search backward and place the instructions before
+ the first parameter is loaded. Do this for everyone for consistency
+ and a presumption that we'll get better code elsewhere as well. */
/* Since different machines initialize their parameter registers
in different orders, assume nothing. Collect the set of all