]> gcc.gnu.org Git - gcc.git/commitdiff
pa.c (pa_reorg): Always put begin_brtab and end_brtab insns around branch tables.
authorJeffrey A Law <law@cygnus.com>
Sat, 23 Aug 1997 06:19:56 +0000 (06:19 +0000)
committerJeff Law <law@gcc.gnu.org>
Sat, 23 Aug 1997 06:19:56 +0000 (00:19 -0600)
        * pa.c (pa_reorg): Always put begin_brtab and end_brtab insns
        around branch tables.
        * pa.md (begin_brtab, end_brtab): Only emit the .begin_brtab
        and .end_brtab directives if TARGET_GAS.
Should fix bootstrap problem with PA port when not using gas.

From-SVN: r14899

gcc/ChangeLog
gcc/config/pa/pa.c
gcc/config/pa/pa.md

index a65ad39acd0d7c648615e9587342c1054c1b14da..5a839c08ceca4144ac1ba8a70866736d96858b74 100644 (file)
@@ -1,3 +1,10 @@
+Sat Aug 23 00:18:22 1997  Jeffrey A Law  (law@cygnus.com)
+
+       * pa.c (pa_reorg): Always put begin_brtab and end_brtab insns
+       around branch tables.
+       * pa.md (begin_brtab, end_brtab): Only emit the .begin_brtab
+       and .end_brtab directives if TARGET_GAS.
+
 Fri Aug 22 14:05:55 1997  Jim Wilson  <wilson@cygnus.com>
 
        * alias.c (true_dependence): Pass x_addr not x to varies.
index 93f7c1d21bee999fa5ced3f641083700cd096d6e..774a288135f352e162b2e5b0b0871723e3ea2335 100644 (file)
@@ -5805,7 +5805,14 @@ following_call (insn)
    The jump instructions within the table are special; we must be able 
    to identify them during assembly output (if the jumps don't get filled
    we need to emit a nop rather than nullifying the delay slot)).  We
-   identify jumps in switch tables by marking the SET with DImode.  */
+   identify jumps in switch tables by marking the SET with DImode. 
+
+   We also surround the jump table itself with BEGIN_BRTAB and END_BRTAB
+   insns.  This serves two purposes, first it prevents jump.c from
+   noticing that the last N entries in the table jump to the instruction
+   immediately after the table and deleting the jumps.  Second, those
+   insns mark where we should emit .begin_brtab and .end_brtab directives
+   when using GAS (allows for better link time optimizations).  */
 
 pa_reorg (insns)
      rtx insns;
@@ -5832,9 +5839,8 @@ pa_reorg (insns)
                  && GET_CODE (PATTERN (insn)) != ADDR_DIFF_VEC))
            continue;
 
-         /* If needed, emit marker for the beginning of the branch table.  */
-         if (TARGET_GAS)
-           emit_insn_before (gen_begin_brtab (), insn);
+         /* Emit marker for the beginning of the branch table.  */
+         emit_insn_before (gen_begin_brtab (), insn);
 
          pattern = PATTERN (insn);
          location = PREV_INSN (insn);
@@ -5873,19 +5879,16 @@ pa_reorg (insns)
              location = NEXT_INSN (location);
            }
 
-         /* If needed, emit marker for the end of the branch table.  */
-         if (TARGET_GAS)
-           {
-             emit_insn_before (gen_end_brtab (), location);
-             location = NEXT_INSN (location);
-             emit_barrier_after (location);
-           }
+         /* Emit marker for the end of the branch table.  */
+         emit_insn_before (gen_end_brtab (), location);
+         location = NEXT_INSN (location);
+         emit_barrier_after (location);
 
          /* Delete the ADDR_VEC or ADDR_DIFF_VEC.  */
          delete_insn (insn);
        }
     }
-  else if (TARGET_GAS)
+  else
     {
       /* Sill need an end_brtab insn.  */
       insns = get_insns ();
index df71400502d96ca81f1bdcc6841acd97be42223c..2f13795399b8a44f2f48152e6bbcb8e17d987c67 100644 (file)
 ;; begin and end.
 (define_insn "begin_brtab"
   [(const_int 1)]
-  "TARGET_GAS"
-  ".begin_brtab"
+  ""
+  "*
+{
+  /* Only GAS actually supports this pseudo-op.  */
+  if (TARGET_GAS)
+    return \".begin_brtab\";
+  else
+    return \"\";
+}"
   [(set_attr "type" "move")
    (set_attr "length" "0")])
 
 (define_insn "end_brtab"
   [(const_int 2)]
-  "TARGET_GAS"
-  ".end_brtab"
+  ""
+  "*
+{
+  /* Only GAS actually supports this pseudo-op.  */
+  if (TARGET_GAS)
+    return \".end_brtab\";
+  else
+    return \"\";
+}"
   [(set_attr "type" "move")
    (set_attr "length" "0")])
 
This page took 0.085664 seconds and 5 git commands to generate.