This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix some -Wunreachable-code issues
- From: "John David Anglin" <dave at hiauly1 dot hia dot nrc dot ca>
- To: thorpej at wasabisystems dot com (Jason R Thorpe)
- Cc: gcc-patches at gcc dot gnu dot org, jakub at redhat dot com, rth at redhat dot com
- Date: Sat, 2 Nov 2002 20:10:19 -0500 (EST)
- Subject: Re: [PATCH] Fix some -Wunreachable-code issues
> On Sat, Nov 02, 2002 at 01:06:54PM -0500, John David Anglin wrote:
>
> > Possibly, contains_insn should only be set to 1 after seeing the first note?
>
> I wonder if PR 3846 is related?
I can't duplicate the PR on hppa2.0w-hp-hpux11.11 or hppa64-hp-hpux11.11.
Jakub's patch might have fixed this PR.
I have now done a complete bootstrap of the enclosed patch on
hppa64-hp-hpux11.11. There are no regressions and it fixes the
failure of -Wunreachable-1.c.
Ok for main?
Dave
--
J. David Anglin dave.anglin@nrc.ca
National Research Council of Canada (613) 990-0752 (FAX: 952-6605)
2002-11-02 John David Anglin <dave@hiauly1.hia.nrc.ca>
* jump.c (never_reached_warning): Don't set contains_insn until the
first line note is seen.
Index: jump.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/jump.c,v
retrieving revision 1.212
diff -u -3 -p -r1.212 jump.c
--- jump.c 30 Sep 2002 19:35:16 -0000 1.212
+++ jump.c 2 Nov 2002 18:22:56 -0000
@@ -1917,7 +1917,7 @@ never_reached_warning (avoided_insn, fin
}
else if (INSN_P (insn))
{
- if (reached_end)
+ if (reached_end || a_line_note == NULL)
break;
contains_insn = 1;
}