Commit 896aa4ea by David Daney Committed by David Daney

cfgbuild.c (find_bb_boundaries): Split blocks containing a barrier.

2009-09-02  David Daney  <ddaney@caviumnetworks.com>

	* cfgbuild.c (find_bb_boundaries): Split blocks containing a
	barrier.
	* emit-rtl.c (prev_nonnote_insn_bb): New function.
	* rtl.h (prev_nonnote_insn_bb): Declare it.

2009-09-02  David Daney  <ddaney@caviumnetworks.com>

	* gcc.c-torture/compile/builtin_unreachable-1.c: New testcase.

From-SVN: r151361
parent 4537ec0c
2009-09-02 David Daney <ddaney@caviumnetworks.com>
* cfgbuild.c (find_bb_boundaries): Split blocks containing a
barrier.
* emit-rtl.c (prev_nonnote_insn_bb): New function.
* rtl.h (prev_nonnote_insn_bb): Declare it.
2009-09-03 Diego Novillo <dnovillo@google.com>
* cgraph.c (cgraph_node_for_decl): New.
......
......@@ -469,6 +469,13 @@ find_bb_boundaries (basic_block bb)
make_edge (ENTRY_BLOCK_PTR, bb, 0);
}
/* __builtin_unreachable () may cause a barrier to be emitted in
the middle of a BB. We need to split it in the same manner
as if the barrier were preceded by a control_flow_insn_p
insn. */
if (code == BARRIER && !flow_transfer_insn)
flow_transfer_insn = prev_nonnote_insn_bb (insn);
/* In case we've previously seen an insn that effects a control
flow transfer, split the block. */
if (flow_transfer_insn && inside_basic_block_p (insn))
......
......@@ -3082,6 +3082,25 @@ prev_nonnote_insn (rtx insn)
return insn;
}
/* Return the previous insn before INSN that is not a NOTE, but stop
the search before we enter another basic block. This routine does
not look inside SEQUENCEs. */
rtx
prev_nonnote_insn_bb (rtx insn)
{
while (insn)
{
insn = PREV_INSN (insn);
if (insn == 0 || !NOTE_P (insn))
break;
if (NOTE_INSN_BASIC_BLOCK_P (insn))
return NULL_RTX;
}
return insn;
}
/* Return the next insn after INSN that is not a DEBUG_INSN. This
routine does not look inside SEQUENCEs. */
......
......@@ -1675,6 +1675,7 @@ extern rtx last_call_insn (void);
extern rtx previous_insn (rtx);
extern rtx next_insn (rtx);
extern rtx prev_nonnote_insn (rtx);
extern rtx prev_nonnote_insn_bb (rtx);
extern rtx next_nonnote_insn (rtx);
extern rtx next_nonnote_insn_bb (rtx);
extern rtx prev_nondebug_insn (rtx);
......
2009-09-02 David Daney <ddaney@caviumnetworks.com>
* gcc.c-torture/compile/builtin_unreachable-1.c: New testcase.
2009-09-03 Diego Novillo <dnovillo@google.com>
* gcc.dg/gomp/combined-1.c: Adjust expected pattern.
......
void bar (const char *);
void foo (void)
{
bar ("foo");
__builtin_unreachable ();
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment