This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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;
 	}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]