aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1995-06-09 18:05:54 -0400
committerRichard Kenner <kenner@gcc.gnu.org>1995-06-09 18:05:54 -0400
commit146135d6db182282472ae6bf16b051128c0db85b (patch)
tree6f75a911763f98b0bd355f08d8888663e6a65f1c /gcc
parent138c94ea17d7d83587a3cac9978124967ba1b5b7 (diff)
downloadgcc-146135d6db182282472ae6bf16b051128c0db85b.zip
gcc-146135d6db182282472ae6bf16b051128c0db85b.tar.gz
gcc-146135d6db182282472ae6bf16b051128c0db85b.tar.bz2
(cse_basic_block): Fix test for whether block ends with a barrier.
Return next insn, not 0, if block ends in a barrier. From-SVN: r9916
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cse.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/gcc/cse.c b/gcc/cse.c
index 9b3aa2e..7f610ce 100644
--- a/gcc/cse.c
+++ b/gcc/cse.c
@@ -8429,22 +8429,25 @@ cse_basic_block (from, to, next_branch, around_loop)
&& GET_CODE (to) == CODE_LABEL && --LABEL_NUSES (to) == to_usage)
{
struct cse_basic_block_data val;
+ rtx prev;
insn = NEXT_INSN (to);
if (LABEL_NUSES (to) == 0)
- delete_insn (to);
+ insn = delete_insn (to);
- /* Find the end of the following block. Note that we won't be
- following branches in this case. If TO was the last insn
- in the function, we are done. Similarly, if we deleted the
- insn after TO, it must have been because it was preceded by
- a BARRIER. In that case, we are done with this block because it
- has no continuation. */
-
- if (insn == 0 || INSN_DELETED_P (insn))
+ /* If TO was the last insn in the function, we are done. */
+ if (insn == 0)
return 0;
+ /* If TO was preceded by a BARRIER we are done with this block
+ because it has no continuation. */
+ prev = prev_nonnote_insn (to);
+ if (prev && GET_CODE (prev) == BARRIER)
+ return insn;
+
+ /* Find the end of the following block. Note that we won't be
+ following branches in this case. */
to_usage = 0;
val.path_size = 0;
cse_end_of_basic_block (insn, &val, 0, 0, 0);