summaryrefslogtreecommitdiffstats
path: root/contrib/gcc/jump.c
diff options
context:
space:
mode:
authorobrien <obrien@FreeBSD.org>2002-05-09 20:02:13 +0000
committerobrien <obrien@FreeBSD.org>2002-05-09 20:02:13 +0000
commitc8f5fc7032940ad6633f932ac40cade82ec4d0cc (patch)
tree29a0f0a6c79a69ecc64f612947a0fe5904311713 /contrib/gcc/jump.c
parentc9ab9ae440a8066b2c2b85b157b1fdadcf09916a (diff)
downloadFreeBSD-src-c8f5fc7032940ad6633f932ac40cade82ec4d0cc.zip
FreeBSD-src-c8f5fc7032940ad6633f932ac40cade82ec4d0cc.tar.gz
Gcc 3.1.0 pre-release from the FSF anoncvs repo on 9-May-2002 15:57:15 EDT.
Diffstat (limited to 'contrib/gcc/jump.c')
-rw-r--r--contrib/gcc/jump.c36
1 files changed, 19 insertions, 17 deletions
diff --git a/contrib/gcc/jump.c b/contrib/gcc/jump.c
index fcb3c61..cad10ff 100644
--- a/contrib/gcc/jump.c
+++ b/contrib/gcc/jump.c
@@ -1,6 +1,6 @@
/* Optimize jump instructions, for GNU compiler.
Copyright (C) 1987, 1988, 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1997
- 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+ 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
This file is part of GCC.
@@ -91,13 +91,6 @@ rebuild_jump_labels (f)
for (insn = forced_labels; insn; insn = XEXP (insn, 1))
if (GET_CODE (XEXP (insn, 0)) == CODE_LABEL)
LABEL_NUSES (XEXP (insn, 0))++;
-
- /* Keep track of labels used for marking handlers for exception
- regions; they cannot usually be deleted. */
-
- for (insn = exception_handler_labels; insn; insn = XEXP (insn, 1))
- if (GET_CODE (XEXP (insn, 0)) == CODE_LABEL)
- LABEL_NUSES (XEXP (insn, 0))++;
}
/* Some old code expects exactly one BARRIER as the NEXT_INSN of a
@@ -1913,13 +1906,12 @@ delete_for_peephole (from, to)
so it's possible to get spurious warnings from this. */
void
-never_reached_warning (avoided_insn)
- rtx avoided_insn;
+never_reached_warning (avoided_insn, finish)
+ rtx avoided_insn, finish;
{
rtx insn;
rtx a_line_note = NULL;
- int two_avoided_lines = 0;
- int contains_insn = 0;
+ int two_avoided_lines = 0, contains_insn = 0, reached_end = 0;
if (! warn_notreached)
return;
@@ -1929,10 +1921,11 @@ never_reached_warning (avoided_insn)
for (insn = avoided_insn; insn != NULL; insn = NEXT_INSN (insn))
{
- if (GET_CODE (insn) == CODE_LABEL)
+ if (finish == NULL && GET_CODE (insn) == CODE_LABEL)
break;
- else if (GET_CODE (insn) == NOTE /* A line number note? */
- && NOTE_LINE_NUMBER (insn) >= 0)
+
+ if (GET_CODE (insn) == NOTE /* A line number note? */
+ && NOTE_LINE_NUMBER (insn) >= 0)
{
if (a_line_note == NULL)
a_line_note = insn;
@@ -1941,7 +1934,14 @@ never_reached_warning (avoided_insn)
!= NOTE_LINE_NUMBER (insn));
}
else if (INSN_P (insn))
- contains_insn = 1;
+ {
+ if (reached_end)
+ break;
+ contains_insn = 1;
+ }
+
+ if (insn == finish)
+ reached_end = 1;
}
if (two_avoided_lines && contains_insn)
warning_with_file_and_line (NOTE_SOURCE_FILE (a_line_note),
@@ -2084,7 +2084,9 @@ redirect_jump (jump, nlabel, delete_unused)
&& NOTE_LINE_NUMBER (NEXT_INSN (olabel)) == NOTE_INSN_FUNCTION_END)
emit_note_after (NOTE_INSN_FUNCTION_END, nlabel);
- if (olabel && --LABEL_NUSES (olabel) == 0 && delete_unused)
+ if (olabel && --LABEL_NUSES (olabel) == 0 && delete_unused
+ /* Undefined labels will remain outside the insn stream. */
+ && INSN_UID (olabel))
delete_related_insns (olabel);
return 1;
OpenPOWER on IntegriCloud