OSDN Git Service

Fix i386-linux build failure.
authorwilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 5 Nov 1997 19:29:37 +0000 (19:29 +0000)
committerwilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 5 Nov 1997 19:29:37 +0000 (19:29 +0000)
* i386.c (load_pic_register): Call prologue_get_pc_and_set_got.
* i386.md (prologue_set_got, prologue_get_pc): Add UNSPEC_VOLATILE
to pattern.
(prologue_get_pc_and_set_got): New pattern.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@16342 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/i386/i386.c
gcc/config/i386/i386.md

index e275e17..2801ba2 100644 (file)
@@ -1,3 +1,10 @@
+Wed Nov  5 11:27:14 1997  Jim Wilson  <wilson@cygnus.com>
+
+       * i386.c (load_pic_register): Call prologue_get_pc_and_set_got.
+       * i386.md (prologue_set_got, prologue_get_pc): Add UNSPEC_VOLATILE
+       to pattern.
+       (prologue_get_pc_and_set_got): New pattern.
+
 Tue Nov  4 20:36:50 1997  Richard Henderson  (rth@cygnus.com)
 
        * alpha.c (summarize_insn): Handle ASM_OPERANDS.  Don't recurse
index 8516911..f411aaa 100644 (file)
@@ -1973,12 +1973,10 @@ load_pic_register (do_rtl)
  
       if (do_rtl)
        {
-         emit_insn (gen_prologue_get_pc (xops[0], xops[1]));
-         emit_insn (gen_pop (xops[0]));
-         emit_insn (gen_prologue_set_got
-                    (xops[0],
-                     gen_rtx (SYMBOL_REF, Pmode, "$_GLOBAL_OFFSET_TABLE_"), 
-                     xops[1]));
+         /* We can't put a raw CODE_LABEL into the RTL, and we can't emit
+            a new CODE_LABEL after reload, so we need a single pattern to
+            emit the 3 necessary instructions.  */
+         emit_insn (gen_prologue_get_pc_and_set_got (xops[0]));
        }
       else
        {
index 64edb55..ea72a98 100644 (file)
@@ -6515,9 +6515,10 @@ byte_xor_operation:
 
 (define_insn "prologue_set_got"
   [(set (match_operand:SI 0 "" "")
-    (plus:SI (match_dup 0)
-     (plus:SI (match_operand:SI 1 "symbolic_operand" "")
-      (minus:SI (pc) (match_operand 2 "" "")))))]
+       (unspec_volatile
+        [(plus:SI (match_dup 0)
+                  (plus:SI (match_operand:SI 1 "symbolic_operand" "")
+                           (minus:SI (pc) (match_operand 2 "" ""))))] 1))]
   ""
   "*
 {
@@ -6538,7 +6539,7 @@ byte_xor_operation:
 
 (define_insn "prologue_get_pc"
   [(set (match_operand:SI 0 "" "")
-    (plus:SI (pc) (match_operand 1 "" "")))]
+    (unspec_volatile [(plus:SI (pc) (match_operand 1 "" ""))] 2))]
   ""
   "*
 {
@@ -6552,6 +6553,20 @@ byte_xor_operation:
   RET;
 }")
 
+(define_insn "prologue_get_pc_and_set_got"
+  [(unspec_volatile [(match_operand:SI 0 "" "")] 3)]
+  ""
+  "*
+{
+  operands[1] = gen_label_rtx ();
+  output_asm_insn (AS1 (call,%P1), operands);
+  ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\",
+                            CODE_LABEL_NUMBER (operands[1]));
+  output_asm_insn (AS1 (pop%L0,%0), operands);
+  output_asm_insn (\"addl $_GLOBAL_OFFSET_TABLE_+[.-%P1],%0\", operands);
+  RET;
+}")
+
 (define_expand "epilogue"
   [(const_int 1)]
   ""