Commit 89a8b315 by Richard Henderson

sparc.h (OVERRIDE_OPTIONS): Don't override -fpic or -fomit-frame-pointer with profiling.

        * config/sparc/sparc.h (OVERRIDE_OPTIONS): Don't override -fpic
        or -fomit-frame-pointer with profiling.
        (SUBTARGET_OVERRIDE_OPTIONS): Remove.
        (FUNCTION_PROFILER): Do nothing.
        (PROFILE_HOOK): New.
        * config/sparc/sparc.c (sparc_override_options): Don't check
        code models for profiling.
        (sparc_function_profiler): Remove.
        (sparc_profile_hook): New.
        * config/sparc/sparc-protos.h: Update.

From-SVN: r51610
parent 6b7d1a34
2002-03-30 Richard Henderson <rth@redhat.com>
PR target/6032
* config/sparc/sparc.h (OVERRIDE_OPTIONS): Don't override -fpic
or -fomit-frame-pointer with profiling.
(SUBTARGET_OVERRIDE_OPTIONS): Remove.
(FUNCTION_PROFILER): Do nothing.
(PROFILE_HOOK): New.
* config/sparc/sparc.c (sparc_override_options): Don't check
code models for profiling.
(sparc_function_profiler): Remove.
(sparc_profile_hook): New.
* config/sparc/sparc-protos.h: Update.
2002-03-30 Jakub Jelinek <jakub@redhat.com> 2002-03-30 Jakub Jelinek <jakub@redhat.com>
PR optimization/6086 PR optimization/6086
...@@ -7,12 +21,14 @@ ...@@ -7,12 +21,14 @@
Sat Mar 30 14:08:55 CET 2002 Jan Hubicka <jh@suse.cz> Sat Mar 30 14:08:55 CET 2002 Jan Hubicka <jh@suse.cz>
* local-alloc.c (local_alloc): Avoid call of update_equiv_regs when not optimizing. * local-alloc.c (local_alloc): Avoid call of update_equiv_regs
when not optimizing.
* toplev.c (rest_of_compilation): Cann mark_constant_function * toplev.c (rest_of_compilation): Cann mark_constant_function
only when optimizing. only when optimizing.
* flow.c (calculate_global_regs_live): Ensure that all AUX fields are NULL. * flow.c (calculate_global_regs_live): Ensure that all AUX fields
are NULL.
* cfgcleanup.c (bb_flags): Add BB_NONTHREADABLE_BLOCK. * cfgcleanup.c (bb_flags): Add BB_NONTHREADABLE_BLOCK.
(thread_jump): Set BB_NONTHREADABLE_BLOCK, check it. (thread_jump): Set BB_NONTHREADABLE_BLOCK, check it.
......
...@@ -57,10 +57,7 @@ extern int check_pic PARAMS ((int)); ...@@ -57,10 +57,7 @@ extern int check_pic PARAMS ((int));
extern int short_branch PARAMS ((int, int)); extern int short_branch PARAMS ((int, int));
extern int sparc_flat_epilogue_delay_slots PARAMS ((void)); extern int sparc_flat_epilogue_delay_slots PARAMS ((void));
extern unsigned long sparc_flat_compute_frame_size PARAMS ((int)); extern unsigned long sparc_flat_compute_frame_size PARAMS ((int));
extern void sparc_function_profiler PARAMS ((FILE *, int)); extern void sparc_profile_hook PARAMS ((int));
extern void sparc_function_block_profiler PARAMS ((FILE *, int));
extern void sparc_block_profiler PARAMS ((FILE *, int));
extern void sparc_function_block_profiler_exit PARAMS ((FILE *));
extern void sparc_override_options PARAMS ((void)); extern void sparc_override_options PARAMS ((void));
extern int leaf_return_peephole_ok PARAMS ((void)); extern int leaf_return_peephole_ok PARAMS ((void));
extern void sparc_output_scratch_registers PARAMS ((FILE *)); extern void sparc_output_scratch_registers PARAMS ((FILE *));
......
...@@ -432,12 +432,6 @@ sparc_override_options () ...@@ -432,12 +432,6 @@ sparc_override_options ()
/* Do various machine dependent initializations. */ /* Do various machine dependent initializations. */
sparc_init_modes (); sparc_init_modes ();
if ((profile_flag)
&& sparc_cmodel != CM_32 && sparc_cmodel != CM_MEDLOW)
{
error ("profiling does not support code models other than medlow");
}
/* Register global variables with the garbage collector. */ /* Register global variables with the garbage collector. */
sparc_add_gc_roots (); sparc_add_gc_roots ();
} }
...@@ -8617,42 +8611,23 @@ sparc_return_peephole_ok (dest, src) ...@@ -8617,42 +8611,23 @@ sparc_return_peephole_ok (dest, src)
return IN_OR_GLOBAL_P (dest); return IN_OR_GLOBAL_P (dest);
} }
/* Output assembler code to FILE to increment profiler label # LABELNO /* Output rtl to increment the profiler label LABELNO
for profiling a function entry. for profiling a function entry. */
32 bit sparc uses %g2 as the STATIC_CHAIN_REGNUM which gets clobbered
during profiling so we need to save/restore it around the call to mcount.
We're guaranteed that a save has just been done, and we use the space
allocated for intreg/fpreg value passing. */
void void
sparc_function_profiler (file, labelno) sparc_profile_hook (labelno)
FILE *file;
int labelno; int labelno;
{ {
char buf[32]; char buf[32];
ASM_GENERATE_INTERNAL_LABEL (buf, "LP", labelno); rtx lab, fun;
if (! TARGET_ARCH64)
fputs ("\tst\t%g2, [%fp-4]\n", file);
fputs ("\tsethi\t%hi(", file); ASM_GENERATE_INTERNAL_LABEL (buf, "LP", labelno);
assemble_name (file, buf); lab = gen_rtx_SYMBOL_REF (Pmode, ggc_strdup (buf));
fputs ("), %o0\n", file); fun = gen_rtx_SYMBOL_REF (Pmode, MCOUNT_FUNCTION);
fputs ("\tcall\t", file);
assemble_name (file, MCOUNT_FUNCTION);
putc ('\n', file);
fputs ("\t or\t%o0, %lo(", file);
assemble_name (file, buf);
fputs ("), %o0\n", file);
if (! TARGET_ARCH64) emit_library_call (fun, 0, VOIDmode, 1, lab, Pmode);
fputs ("\tld\t[%fp-4], %g2\n", file);
} }
/* Mark ARG, which is really a struct ultrasparc_pipline_state *, for /* Mark ARG, which is really a struct ultrasparc_pipline_state *, for
GC. */ GC. */
......
...@@ -373,29 +373,7 @@ Unrecognized value in TARGET_CPU_DEFAULT. ...@@ -373,29 +373,7 @@ Unrecognized value in TARGET_CPU_DEFAULT.
/* Show we can debug even without a frame pointer. */ /* Show we can debug even without a frame pointer. */
#define CAN_DEBUG_WITHOUT_FP #define CAN_DEBUG_WITHOUT_FP
/* To make profiling work with -f{pic,PIC}, we need to emit the profiling #define OVERRIDE_OPTIONS sparc_override_options ()
code into the rtl. Also, if we are profiling, we cannot eliminate
the frame pointer (because the return address will get smashed). */
#define OVERRIDE_OPTIONS \
do { \
if (profile_flag || profile_arc_flag) \
{ \
if (flag_pic) \
{ \
const char *const pic_string = (flag_pic == 1) ? "-fpic" : "-fPIC";\
warning ("%s and profiling conflict: disabling %s", \
pic_string, pic_string); \
flag_pic = 0; \
} \
flag_omit_frame_pointer = 0; \
} \
sparc_override_options (); \
SUBTARGET_OVERRIDE_OPTIONS; \
} while (0)
/* This is meant to be redefined in the host dependent files. */
#define SUBTARGET_OVERRIDE_OPTIONS
/* Generate DBX debugging information. */ /* Generate DBX debugging information. */
...@@ -1854,14 +1832,13 @@ do { \ ...@@ -1854,14 +1832,13 @@ do { \
#endif #endif
/* Output assembler code to FILE to increment profiler label # LABELNO /* Emit rtl for profiling. */
for profiling a function entry. */ #define PROFILE_HOOK(LABEL) sparc_profile_hook (LABEL)
#define FUNCTION_PROFILER(FILE, LABELNO) \ /* All the work done in PROFILE_HOOK, but still required. */
sparc_function_profiler(FILE, LABELNO) #define FUNCTION_PROFILER(FILE, LABELNO) do { } while (0)
/* Set the name of the mcount function for the system. */ /* Set the name of the mcount function for the system. */
#define MCOUNT_FUNCTION "*mcount" #define MCOUNT_FUNCTION "*mcount"
/* EXIT_IGNORE_STACK should be nonzero if, when returning from a function, /* EXIT_IGNORE_STACK should be nonzero if, when returning from a function,
......
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