rs6000.c (rs6000_traceback_name): New var.

* config/rs6000/rs6000.c (rs6000_traceback_name): New var.
	(rs6000_traceback): New var.
	(rs6000_override_options): Set rs6000_traceback.
	(rs6000_output_function_epilogue): Implement traceback options.
	* config/rs6000/rs6000.h (TARGET_OPTIONS): Add "traceback=".
	(rs6000_traceback_name): Declare.

	* config/rs6000/rs6000.c (output_profile_hook): Don't generate profile
	label reference when NO_PROFILE_COUNTERS.

From-SVN: r55787
This commit is contained in:
Alan Modra 2002-07-26 23:46:47 +00:00 committed by Alan Modra
parent bacb811db6
commit 57ac7be93e
3 changed files with 52 additions and 4 deletions

View File

@ -1,3 +1,15 @@
2002-07-27 Alan Modra <amodra@bigpond.net.au>
* config/rs6000/rs6000.c (rs6000_traceback_name): New var.
(rs6000_traceback): New var.
(rs6000_override_options): Set rs6000_traceback.
(rs6000_output_function_epilogue): Implement traceback options.
* config/rs6000/rs6000.h (TARGET_OPTIONS): Add "traceback=".
(rs6000_traceback_name): Declare.
* config/rs6000/rs6000.c (output_profile_hook): Don't generate profile
label reference when NO_PROFILE_COUNTERS.
2002-07-26 Jason Merrill <jason@redhat.com>
* function.c (assign_parms): Handle frontend-directed pass by

View File

@ -129,6 +129,14 @@ const char *rs6000_debug_name;
int rs6000_debug_stack; /* debug stack applications */
int rs6000_debug_arg; /* debug argument handling */
const char *rs6000_traceback_name;
static enum {
traceback_default = 0,
traceback_none,
traceback_part,
traceback_full
} rs6000_traceback;
/* Flag to say the TOC is initialized */
int toc_initialized;
char toc_label_name[10];
@ -600,6 +608,19 @@ rs6000_override_options (default_cpu)
error ("unknown -mdebug-%s switch", rs6000_debug_name);
}
if (rs6000_traceback_name)
{
if (! strncmp (rs6000_traceback_name, "full", 4))
rs6000_traceback = traceback_full;
else if (! strncmp (rs6000_traceback_name, "part", 4))
rs6000_traceback = traceback_part;
else if (! strncmp (rs6000_traceback_name, "no", 2))
rs6000_traceback = traceback_none;
else
error ("unknown -mtraceback arg `%s'; expecting `full', `partial' or `none'",
rs6000_traceback_name);
}
/* Set size of long double */
rs6000_long_double_type_size = 64;
if (rs6000_long_double_size_string)
@ -10818,7 +10839,6 @@ rs6000_output_function_epilogue (file, size)
HOST_WIDE_INT size ATTRIBUTE_UNUSED;
{
rs6000_stack_t *info = rs6000_stack_info ();
int optional_tbtab = (optimize_size || TARGET_ELF) ? 0 : 1;
if (! HAVE_epilogue)
{
@ -10871,12 +10891,21 @@ rs6000_output_function_epilogue (file, size)
System V.4 Powerpc's (and the embedded ABI derived from it) use a
different traceback table. */
if (DEFAULT_ABI == ABI_AIX && ! flag_inhibit_size_directive)
if (DEFAULT_ABI == ABI_AIX && ! flag_inhibit_size_directive
&& rs6000_traceback != traceback_none)
{
const char *fname = XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0);
const char *language_string = lang_hooks.name;
int fixed_parms = 0, float_parms = 0, parm_info = 0;
int i;
int optional_tbtab;
if (rs6000_traceback == traceback_full)
optional_tbtab = 1;
else if (rs6000_traceback == traceback_part)
optional_tbtab = 0;
else
optional_tbtab = !optimize_size && !TARGET_ELF;
while (*fname == '.') /* V.4 encodes . in the name */
fname++;
@ -11070,7 +11099,6 @@ rs6000_output_function_epilogue (file, size)
fputs ("\t.align 2\n", file);
}
return;
}
/* A C compound statement that outputs the assembler code for a thunk
@ -11835,10 +11863,13 @@ rs6000_gen_section_name (buf, filename, section_desc)
void
output_profile_hook (labelno)
int labelno;
int labelno ATTRIBUTE_UNUSED;
{
if (DEFAULT_ABI == ABI_AIX)
{
#ifdef NO_PROFILE_COUNTERS
emit_library_call (init_one_libfunc (RS6000_MCOUNT), 0, VOIDmode, 0);
#else
char buf[30];
const char *label_name;
rtx fun;
@ -11849,6 +11880,7 @@ output_profile_hook (labelno)
emit_library_call (init_one_libfunc (RS6000_MCOUNT), 0, VOIDmode, 1,
fun, Pmode);
#endif
}
else if (DEFAULT_ABI == ABI_DARWIN)
{

View File

@ -392,6 +392,8 @@ extern enum processor_type rs6000_cpu;
{"tune=", &rs6000_select[2].string, \
N_("Schedule code for given CPU") }, \
{"debug=", &rs6000_debug_name, N_("Enable debug output") }, \
{"traceback=", &rs6000_traceback_name, \
N_("Select full, part, or no traceback table") }, \
{"abi=", &rs6000_abi_string, N_("Specify ABI to use") }, \
{"long-double-", &rs6000_long_double_size_string, \
N_("Specify size of long double (64 or 128 bits)") }, \
@ -425,6 +427,8 @@ extern int rs6000_debug_arg; /* debug argument handling */
#define TARGET_DEBUG_STACK rs6000_debug_stack
#define TARGET_DEBUG_ARG rs6000_debug_arg
extern const char *rs6000_traceback_name; /* Type of traceback table. */
/* These are separate from target_flags because we've run out of bits
there. */
extern const char *rs6000_long_double_size_string;