Commit d8d5b1e1 by Michael Meissner

Do not allow insns to be scheduled before prologue insns if profiling.

From-SVN: r2766
parent 28bbe06b
...@@ -4207,6 +4207,12 @@ mips_expand_prologue () ...@@ -4207,6 +4207,12 @@ mips_expand_prologue ()
if (frame_pointer_needed) if (frame_pointer_needed)
emit_insn (gen_movsi (frame_pointer_rtx, stack_pointer_rtx)); 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 ());
} }
......
...@@ -482,7 +482,7 @@ while (0) ...@@ -482,7 +482,7 @@ while (0)
/* Print subsidiary information on the compiler version in use. */ /* 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 #ifndef MACHINE_TYPE
#define MACHINE_TYPE "BSD Mips" #define MACHINE_TYPE "BSD Mips"
...@@ -1929,6 +1929,12 @@ typedef struct mips_args { ...@@ -1929,6 +1929,12 @@ typedef struct mips_args {
fprintf (FILE, "\t.set\tat\n"); \ 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, /* EXIT_IGNORE_STACK should be nonzero if, when returning from a function,
the stack pointer does not matter. The value is tested only in the stack pointer does not matter. The value is tested only in
functions that have frame pointers. functions that have frame pointers.
......
...@@ -4003,6 +4003,18 @@ move\\t%0,%z4\\n\\ ...@@ -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 ;; At present, don't expand the epilogue, reorg.c will clobber the
;; return register in compiling gen_lowpart (emit-rtl.c). ;; return register in compiling gen_lowpart (emit-rtl.c).
;; ;;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment