OSDN Git Service

Do not allow insns to be scheduled before prologue insns if profiling.
authormeissner <meissner@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 21 Nov 1992 12:53:59 +0000 (12:53 +0000)
committermeissner <meissner@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 21 Nov 1992 12:53:59 +0000 (12:53 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@2766 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/config/mips/mips.c
gcc/config/mips/mips.h
gcc/config/mips/mips.md

index 5c73d53..8d18d6b 100644 (file)
@@ -4207,6 +4207,12 @@ mips_expand_prologue ()
       if (frame_pointer_needed)
        emit_insn (gen_movsi (frame_pointer_rtx, stack_pointer_rtx));
     }
+
+  /* If we are profiling, make sure no instructions are scheduled before
+     the call to mcount.  */
+
+  if (profile_flag || profile_block_flag)
+    emit_insn (gen_blockage ());
 }
 
 \f
index ef81806..49c54e2 100644 (file)
@@ -482,7 +482,7 @@ while (0)
 \f
 /* Print subsidiary information on the compiler version in use.  */
 
-#define MIPS_VERSION "[AL 1.1, MM 28]"
+#define MIPS_VERSION "[AL 1.1, MM 29]"
 
 #ifndef MACHINE_TYPE
 #define MACHINE_TYPE "BSD Mips"
@@ -1929,6 +1929,12 @@ typedef struct mips_args {
   fprintf (FILE, "\t.set\tat\n");                                      \
 }
 
+/* Define this macro if the code for function profiling should come
+   before the function prologue.  Normally, the profiling code comes
+   after.  */
+
+/* #define PROFILE_BEFORE_PROLOGUE */
+
 /* EXIT_IGNORE_STACK should be nonzero if, when returning from a function,
    the stack pointer does not matter.  The value is tested only in
    functions that have frame pointers.
index d4a26f2..1e40306 100644 (file)
@@ -4003,6 +4003,18 @@ move\\t%0,%z4\\n\\
     }
 }")
 
+;; Block any insns from being moved before this point, since the
+;; profiling call to mcount can use various registers that aren't
+;; saved or used to pass arguments.
+
+(define_insn "blockage"
+  [(unspec_volatile [(const_int 0)] 0)]
+  ""
+  ""
+  [(set_attr "type"    "unknown")
+   (set_attr "mode"    "none")
+   (set_attr "length"  "0")])
+
 ;; At present, don't expand the epilogue, reorg.c will clobber the
 ;; return register in compiling gen_lowpart (emit-rtl.c).
 ;;