Fix shared library problem found by GNAT users.
authorJim Wilson <wilson@cygnus.com>
Wed, 5 Nov 1997 00:55:50 +0000 (00:55 +0000)
committerJim Wilson <wilson@gcc.gnu.org>
Wed, 5 Nov 1997 00:55:50 +0000 (16:55 -0800)
* mips.c (mips_expand_epilogue): Emit blockage insn before call to
save_restore_insns if no FP and GP will be restored.

From-SVN: r16327

gcc/ChangeLog
gcc/config/mips/mips.c

index 2f981e9df7489e913cb7aa58785349344ebb367a..7a3f4da7a73c5da11984648a8b70522284f0cf6d 100644 (file)
@@ -1,4 +1,7 @@
-Tue Nov  4 12:30:28 1997  Jim Wilson  <wilson@cygnus.com>
+Tue Nov  4 16:55:11 1997  Jim Wilson  <wilson@cygnus.com>
+
+       * mips.c (mips_expand_epilogue): Emit blockage insn before call to
+       save_restore_insns if no FP and GP will be restored.
 
        * dwarf2out.c (expand_builtin_dwarf_reg_size): New variable mode.
        Convert CCmode to word_mode before calling GET_MODE_SIZE.
index 85164356d887379b4fce9637eeddafd495899e14..2d6984b8737be9ef663e31b1829d10d35093ee4f 100644 (file)
@@ -5591,6 +5591,13 @@ mips_expand_epilogue ()
          else
            emit_insn (gen_movsi (stack_pointer_rtx, frame_pointer_rtx));
        }
+      /* The GP/PIC register is implicitly used by all SYMBOL_REFs, so if we
+        are going to restore it, then we must emit a blockage insn to
+        prevent the scheduler from moving the restore out of the epilogue.  */
+      else if (TARGET_ABICALLS && mips_abi != ABI_32
+              && (current_frame_info.mask
+                  & (1L << (PIC_OFFSET_TABLE_REGNUM - GP_REG_FIRST))))
+       emit_insn (gen_blockage ());
 
       save_restore_insns (FALSE, tmp_rtx, tsize, (FILE *)0);