aboutsummaryrefslogtreecommitdiff
path: root/gcc/emit-rtl.c
diff options
context:
space:
mode:
authorDavid Daney <ddaney@caviumnetworks.com>2009-09-03 05:01:40 +0000
committerDavid Daney <daney@gcc.gnu.org>2009-09-03 05:01:40 +0000
commit896aa4eae3cd9f463597e8717ac8722ff7050965 (patch)
treebcd50e973902119516f03bdc0a265a1b5dc16135 /gcc/emit-rtl.c
parent4537ec0c8652889bc6decbcf5647f889d2a14733 (diff)
downloadgcc-896aa4eae3cd9f463597e8717ac8722ff7050965.zip
gcc-896aa4eae3cd9f463597e8717ac8722ff7050965.tar.gz
gcc-896aa4eae3cd9f463597e8717ac8722ff7050965.tar.bz2
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
Diffstat (limited to 'gcc/emit-rtl.c')
-rw-r--r--gcc/emit-rtl.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c
index 9096a62..65022fc 100644
--- a/gcc/emit-rtl.c
+++ b/gcc/emit-rtl.c
@@ -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. */