summaryrefslogtreecommitdiffstats
path: root/gcc/cfganal.c
diff options
context:
space:
mode:
authoruweigand <uweigand@138bc75d-0d04-0410-961f-82ee72b054a4>2004-02-06 18:31:33 +0000
committeruweigand <uweigand@138bc75d-0d04-0410-961f-82ee72b054a4>2004-02-06 18:31:33 +0000
commit867af57235a3fb7e4204fd40c9a3e52d077ebe18 (patch)
tree0a45d5a5c934f17bee1657e72f74c8d4cdc93901 /gcc/cfganal.c
parent71c23453ac412fdfaa0622631841de93527bb348 (diff)
downloadppe42-gcc-867af57235a3fb7e4204fd40c9a3e52d077ebe18.tar.gz
ppe42-gcc-867af57235a3fb7e4204fd40c9a3e52d077ebe18.zip
* cfganal.c (flow_call_edges_add): Never split a libcall block.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@77410 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cfganal.c')
-rw-r--r--gcc/cfganal.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/gcc/cfganal.c b/gcc/cfganal.c
index 91297e53daa..aa3965cac07 100644
--- a/gcc/cfganal.c
+++ b/gcc/cfganal.c
@@ -333,6 +333,7 @@ flow_call_edges_add (sbitmap blocks)
for (i = 0; i < last_bb; i++)
{
basic_block bb = BASIC_BLOCK (i);
+ rtx libcall_end = NULL_RTX;
rtx insn;
rtx prev_insn;
@@ -350,9 +351,13 @@ flow_call_edges_add (sbitmap blocks)
edge e;
rtx split_at_insn = insn;
+ /* Don't split libcalls. */
+ if (libcall_end)
+ split_at_insn = libcall_end;
+
/* Don't split the block between a call and an insn that should
remain in the same block as the call. */
- if (GET_CODE (insn) == CALL_INSN)
+ else if (GET_CODE (insn) == CALL_INSN)
while (split_at_insn != BB_END (bb)
&& keep_with_call_p (NEXT_INSN (split_at_insn)))
split_at_insn = NEXT_INSN (split_at_insn);
@@ -381,6 +386,14 @@ flow_call_edges_add (sbitmap blocks)
make_edge (bb, EXIT_BLOCK_PTR, EDGE_FAKE);
}
+ /* Watch out for REG_LIBCALL/REG_RETVAL notes so that we know
+ whether we are currently in a libcall or not. Remember that
+ we are scanning backwards! */
+ if (find_reg_note (insn, REG_RETVAL, NULL_RTX))
+ libcall_end = insn;
+ if (find_reg_note (insn, REG_LIBCALL, NULL_RTX))
+ libcall_end = NULL_RTX;
+
if (insn == BB_HEAD (bb))
break;
}
OpenPOWER on IntegriCloud