re PR middle-end/8866 (Bug in switch statement code generation -- missing label)
authorMark Mitchell <mark@codesourcery.com>
Wed, 16 Apr 2003 20:39:12 +0000 (20:39 +0000)
committerMark Mitchell <mmitchel@gcc.gnu.org>
Wed, 16 Apr 2003 20:39:12 +0000 (20:39 +0000)
PR middle-end/8866
* cfgtrl.c (try_redirect_by_replacing_jump): Do not delete
jumptables.

PR middle-end/8866
* libjava.lang/PR8866.java: New test.

From-SVN: r65698

gcc/ChangeLog
gcc/cfgrtl.c
libjava/testsuite/ChangeLog
libjava/testsuite/libjava.lang/PR8866.java [new file with mode: 0644]

index a7d59b8..f95d702 100644 (file)
@@ -1,3 +1,9 @@
+2003-04-16  Mark Mitchell  <mark@codesourcery.com>
+
+       PR middle-end/8866
+       * cfgtrl.c (try_redirect_by_replacing_jump): Do not delete
+       jumptables.
+
 2003-04-16  Richard Henderson  <rth@redhat.com>
 
        * config/ia64/ia64.c (sdata_symbolic_operand): Use
index 0ba32c5..394632c 100644 (file)
@@ -731,7 +731,7 @@ try_redirect_by_replacing_jump (e, target)
   else
     {
       rtx target_label = block_label (target);
-      rtx barrier, label, table;
+      rtx barrier;
 
       emit_jump_insn_after (gen_jump (target_label), insn);
       JUMP_LABEL (src->end) = target_label;
@@ -740,15 +740,10 @@ try_redirect_by_replacing_jump (e, target)
        fprintf (rtl_dump_file, "Replacing insn %i by jump %i\n",
                 INSN_UID (insn), INSN_UID (src->end));
 
-
+      /* Remove the original jump.  If INSN is a tablejump, the jump
+        table will be removed later, if it is no longer needed.  */
       delete_insn_chain (kill_from, insn);
 
-      /* Recognize a tablejump that we are converting to a
-        simple jump and remove its associated CODE_LABEL
-        and ADDR_VEC or ADDR_DIFF_VEC.  */
-      if (tablejump_p (insn, &label, &table))
-       delete_insn_chain (label, table);
-
       barrier = next_nonnote_insn (src->end);
       if (!barrier || GET_CODE (barrier) != BARRIER)
        emit_barrier_after (src->end);
index 2ec01f3..96b3930 100644 (file)
@@ -1,3 +1,8 @@
+2003-04-16  Mark Mitchell  <mark@codesourcery.com>
+
+       PR middle-end/8866
+       * libjava.lang/PR8866.java: New test.
+
 2003-04-16  Andrew Haley  <aph@redhat.com>
 
        * libjava.lang/Throw_2.java (main): Make a successful test produce
diff --git a/libjava/testsuite/libjava.lang/PR8866.java b/libjava/testsuite/libjava.lang/PR8866.java
new file mode 100644 (file)
index 0000000..fa62066
--- /dev/null
@@ -0,0 +1,22 @@
+public class PR8866
+{
+  public static void main (String args[])
+    {
+      String attTypeString = "";
+
+      switch (args.length) {
+      case 1:
+          attTypeString = "string";
+      case 4:
+          attTypeString = "ID";;
+      case 5:
+          attTypeString = "IDREF";;
+      case 6:
+          attTypeString = "NMTOKEN";;
+      case 7:
+          attTypeString = "NOTATION";;
+      default:
+          ;
+      }
+    }
+}