diff --git a/libjava/testsuite/ChangeLog b/libjava/testsuite/ChangeLog
index 9dcf38deb6798030f42f547835b34663026acfc0..8791dd4ec85cfe13397de837cb455aee31ee1221 100644
--- a/libjava/testsuite/ChangeLog
+++ b/libjava/testsuite/ChangeLog
@@ -1,3 +1,19 @@
+2002-12-12  Tom Tromey  <tromey@redhat.com>
+
+	* libjava.loader/loader.exp (gcj_loader_test_one): Use
+	libjava_prune_warnings.
+	(gcj_loader_run): Likewise.
+	* libjava.mauve/mauve.exp (test_mauve): Use
+	libjava_prune_warnings.
+	(test_mauve_sim): Likewise.
+	* libjava.jni/jni.exp (gcj_jni_compile_c_to_so): Use
+	libjava_prune_warnings.
+	(gcj_jni_build_header): Likewise.
+	* lib/libjava.exp (libjava_prune_warnings): New proc.
+	(gcj_link): Use it.
+	(test_libjava_from_source): Likewise.
+	(test_libjava_from_javac): Likewise.
+
 2002-12-08  Tom Tromey  <tromey@redhat.com>
 
 	Test for PR libgcj/8823:
diff --git a/libjava/testsuite/lib/libjava.exp b/libjava/testsuite/lib/libjava.exp
index 3cb6140438d8d7fb144efcf0e17d9ccf315d6ef2..a807c4c8d60d0ac4d6e78f7e5f3163ce925a66e8 100644
--- a/libjava/testsuite/lib/libjava.exp
+++ b/libjava/testsuite/lib/libjava.exp
@@ -10,6 +10,22 @@ if ![info exists tmpdir] {
     set tmpdir "/tmp"
 }
 
+# This is like `prune_warnings', but it also prunes away a warning
+# from the bytecode front end that we don't care about.
+proc libjava_prune_warnings {text} {
+    set text [prune_warnings $text]
+    set tlist [split $text \n]
+    set len [llength $tlist]
+    for {set i [expr {$len - 1}]} {$i >= 2} {incr i -1} {
+	if {[string match "*unreachable bytecode*" [lindex $tlist $i]]} {
+	    # Delete this line and the previous two lines.
+	    set tlist [lreplace $tlist [expr {$i - 2}] $i]
+	    incr i -2
+	}
+    }
+    return [join $tlist \n]
+}
+
 # This is like `target_compile' but it does some surgery to work
 # around stupid DejaGNU bugs.  In particular DejaGNU has very poor
 # quoting, so for instance a `$' will be re-evaluated at spawn time.
@@ -421,8 +437,8 @@ proc gcj_link {program main files {options {}}} {
 	eval lappend arguments $options
     }
     lappend arguments "additional_flags=--main=$main"
-    set x [prune_warnings [libjava_tcompile $files $program executable \
-			     $arguments]]
+    set x [libjava_prune_warnings \
+	     [libjava_tcompile $files $program executable $arguments]]
     if {$x != ""} {
 	verbose "link failure: $x" 2
 	fail "linking $program"
@@ -569,7 +585,7 @@ proc test_libjava_from_source { options srcfile compile_args inpfile resultfile
 
     set removeList [list $executable]
 
-    set x [prune_warnings \
+    set x [libjava_prune_warnings \
 	     [libjava_tcompile $srcfile "$executable" $target $args]]
     if {[info exists opts(xfail-gcj)]} {
 	setup_xfail *-*-*
@@ -683,11 +699,11 @@ proc test_libjava_from_javac { options srcfile compile_args inpfile resultfile e
     set jvscan [find_jvscan]
     verbose "jvscan is $jvscan"
     set main_name [string trim \
-		     [prune_warnings \
+		     [libjava_prune_warnings \
 			[lindex [local_exec "$jvscan --encoding=UTF-8 $srcfile --print-main" "" "" 300] 1]]]
     verbose "main name is $main_name"
     set class_out [string trim \
-		     [prune_warnings \
+		     [libjava_prune_warnings \
 			[lindex [local_exec "$jvscan --encoding=UTF-8 $srcfile --list-class" "" "" 300] 1]]]
     verbose "class list is $class_out"
 
@@ -765,7 +781,7 @@ proc test_libjava_from_javac { options srcfile compile_args inpfile resultfile e
     if {$mode == "compile"} {
 	foreach c_file $class_files {
 	    set executable [file rootname [file tail $c_file]].o
-	    set x [prune_warnings \
+	    set x [libjava_prune_warnings \
 		     [libjava_tcompile $c_file "$executable" $type $args]]
 	    lappend removeList $executable
 	    if {$x != ""} {
@@ -781,7 +797,7 @@ proc test_libjava_from_javac { options srcfile compile_args inpfile resultfile e
 	    set hack "$hack $stupid"
 	}
 	lappend removeList $executable
-	set x [prune_warnings \
+	set x [libjava_prune_warnings \
 		 [libjava_tcompile $hack "$executable" $type $args]]
     }
     if {[info exists opts(xfail-byte)]} {
diff --git a/libjava/testsuite/libjava.jni/jni.exp b/libjava/testsuite/libjava.jni/jni.exp
index efd8154eb2313803f1ef56c34444bbfc66a972bb..2aec4c9bf8bc0f2d1ce9971dc1707d50bb7645e1 100644
--- a/libjava/testsuite/libjava.jni/jni.exp
+++ b/libjava/testsuite/libjava.jni/jni.exp
@@ -15,7 +15,8 @@ proc gcj_jni_compile_c_to_so {file {options {}}} {
   # Find jni.h.
   lappend options "additional_flags=-I$srcdir/../include"
 
-  set x [prune_warnings [target_compile $file $soname executable $options]]
+  set x [libjava_prune_warnings \
+	   [target_compile $file $soname executable $options]]
   if {$x != ""} {
     verbose "target_compile failed: $x" 2
     fail "$name.c compilation"
@@ -30,7 +31,7 @@ proc gcj_jni_compile_c_to_so {file {options {}}} {
 proc gcj_jni_build_header {file} {
   set gcjh [find_gcjh]
   set file [file rootname $file]
-  set x [string trim [prune_warnings \
+  set x [string trim [libjava_prune_warnings \
 			[lindex [local_exec "$gcjh -jni $file" "" "" 300] 1]]]
   if {$x != ""} {
     verbose "local_exec failed: $x" 2
diff --git a/libjava/testsuite/libjava.loader/loader.exp b/libjava/testsuite/libjava.loader/loader.exp
index 6864a5f663ab99ef3f6088a4ad4b42be35fde17e..e306a312c83df11ee2b3aded3bc2e0bde728aaf0 100644
--- a/libjava/testsuite/libjava.loader/loader.exp
+++ b/libjava/testsuite/libjava.loader/loader.exp
@@ -12,7 +12,7 @@ proc gcj_loader_test_one {srcfile} {
     set errname [file rootname [file tail $srcfile]]
     set args [libjava_arguments link]
     lappend args "additional_flags=--main=[file rootname [file tail $srcfile]] $srcdir/$subdir/MyLoader.java $objdir/dummy.o"
-  set x [prune_warnings \
+  set x [libjava_prune_warnings \
 	     [libjava_tcompile $srcfile "$executable" executable $args]]
 
     if { $x != "" } {
@@ -46,8 +46,8 @@ proc gcj_loader_run {} {
 
   set args [libjava_arguments compile]
   lappend args "additional_flags=--resource $objdir/dummy.class"
-  set x [prune_warnings \
-	     [libjava_tcompile "$objdir/dummy.class" "$objdir/dummy.o" object $args]]
+  set x [libjava_prune_warnings \
+	   [libjava_tcompile "$objdir/dummy.class" "$objdir/dummy.o" object $args]]
 
     if { $x != "" } {
 	verbose "resource compilation failed: $x" 2
diff --git a/libjava/testsuite/libjava.mauve/mauve.exp b/libjava/testsuite/libjava.mauve/mauve.exp
index a9a1c98d6ac3ebf9d7e8062a8eb9076eb37bc6bb..1ca2884249c450b63dcce94e682fae5495cacebe 100644
--- a/libjava/testsuite/libjava.mauve/mauve.exp
+++ b/libjava/testsuite/libjava.mauve/mauve.exp
@@ -154,7 +154,7 @@ proc test_mauve {} {
   foreach base {DejaGNUTestHarness gnu/testlet/SimpleTestHarness gnu/testlet/TestHarness gnu/testlet/Testlet gnu/testlet/ResourceNotFoundException gnu/testlet/config} {
     set file $base.class
     set obj $base.o
-    set x [prune_warnings \
+    set x [libjava_prune_warnings \
 	     [target_compile [pwd]/$file $obj object $compile_args]]
     if {$x != ""} then {
       fail "Compile $obj"
@@ -180,7 +180,7 @@ proc test_mauve {} {
       if {! [file exists $obj]} then {
 	verbose "compiling $obj for test of $class"
 	set srcfile [file rootname $obj].class
-	set x [prune_warnings \
+	set x [libjava_prune_warnings \
 		 [target_compile [pwd]/$srcfile $obj object $compile_args]]
 	if {$x != ""} then {
 	  fail "Compile $obj for $class"
@@ -195,8 +195,9 @@ proc test_mauve {} {
       continue
     }
 
-    set x [prune_warnings [target_compile [concat $uses($file) $objlist] \
-			     $Executable executable $link_args]]
+    set x [libjava_prune_warnings \
+	     [target_compile [concat $uses($file) $objlist] \
+		$Executable executable $link_args]]
     if {$x != ""} then {
       set proc_ok 0
       fail "Link for $class"
@@ -292,7 +293,7 @@ proc test_mauve_sim {} {
 		  gnu/testlet/config} {
     set file $base.class
     set obj $base.o
-    set x [prune_warnings \
+    set x [libjava_prune_warnings \
 	     [target_compile [pwd]/$file $obj object $compile_args]]
     if {$x != ""} then {
       fail "Compile $obj"
@@ -321,7 +322,7 @@ proc test_mauve_sim {} {
       if {! [file exists $obj]} then {
 	verbose "compiling $obj for test of $class"
 	set srcfile [file rootname $obj].class
-	set x [prune_warnings \
+	set x [libjava_prune_warnings \
 		 [target_compile [pwd]/$srcfile $obj object $compile_args]]
 	if {$x != ""} then {
 	  fail "Compile $obj for $class"
@@ -357,7 +358,7 @@ proc test_mauve_sim {} {
 	return 0
     }
 
-    set x [prune_warnings \
+    set x [libjava_prune_warnings \
 	     [target_compile gnu/testlet/DejaGNUTestHarness.class \
 		gnu/testlet/DejaGNUTestHarness.o object $compile_args]]
     if {$x != ""} then {
@@ -366,8 +367,9 @@ proc test_mauve_sim {} {
 	continue
     }
 
-    set x [prune_warnings [target_compile [concat $uses($file) $objlist] \
-			     $Executable executable $link_args]]
+    set x [libjava_prune_warnings \
+	     [target_compile [concat $uses($file) $objlist] \
+		$Executable executable $link_args]]
     if {$x != ""} then {
       set proc_ok 0
       fail "Link for $class"