aboutsummaryrefslogtreecommitdiff
path: root/gcc/config
diff options
context:
space:
mode:
authorAlan Modra <amodra@bigpond.net.au>2002-04-23 07:20:55 +0000
committerAlan Modra <amodra@gcc.gnu.org>2002-04-23 16:50:55 +0930
commitf6f315fe1143ddf98f1eb66becabbb10aa92e0a3 (patch)
treefdb47569e86fdbcfcd516dea2f4adaa666e43043 /gcc/config
parent878a19ebe2b42ac126f62e4f3d3d2d70f0be26c2 (diff)
downloadgcc-f6f315fe1143ddf98f1eb66becabbb10aa92e0a3.zip
gcc-f6f315fe1143ddf98f1eb66becabbb10aa92e0a3.tar.gz
gcc-f6f315fe1143ddf98f1eb66becabbb10aa92e0a3.tar.bz2
re PR target/6413 (PROFILE_HOOK label_no)
PR target/6413 * function.h: (struct function): Add profile_label_no field. (current_function_profile_label_no): Define. * function.c: (profile_label_no): New static var. (expand_function_start): Increment it, and copy to current_function_profile_label_no. * output.h (profile_label_no): Delete. * final.c (profile_label_no): Delete. (profile_function): Use current_function_profile_label_no. (final_end_function): Don't increment profile_label_no here. * config/i386/i386.c (ix86_osf_output_function_prologue): Replace profile_label_no with current_function_profile_label_no. * config/pa/pa.c (current_function_number): Delete. (pa_output_function_prologue): Don't output profile label here. (hppa_profile_hook): Use label_no param rather than current_function_number. (FUNC_BEGIN_PROLOG_LABEL): Move to .. * config/pa/pa.h: .. here. (FUNCTION_PROFILER): Output profile label here. From-SVN: r52656
Diffstat (limited to 'gcc/config')
-rw-r--r--gcc/config/i386/i386.c2
-rw-r--r--gcc/config/pa/pa.c23
-rw-r--r--gcc/config/pa/pa.h11
3 files changed, 12 insertions, 24 deletions
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 41ec025..f134a21 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -1335,7 +1335,7 @@ ix86_osf_output_function_prologue (file, size)
{
const char *prefix = "";
const char *const lprefix = LPREFIX;
- int labelno = profile_label_no;
+ int labelno = current_function_profile_label_no;
#ifdef OSF_OS
diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c
index 9163aab..e5259da 100644
--- a/gcc/config/pa/pa.c
+++ b/gcc/config/pa/pa.c
@@ -57,10 +57,6 @@ Boston, MA 02111-1307, USA. */
#endif
#endif
-#ifndef FUNC_BEGIN_PROLOG_LABEL
-#define FUNC_BEGIN_PROLOG_LABEL "LFBP"
-#endif
-
static inline rtx force_mode PARAMS ((enum machine_mode, rtx));
static void pa_combine_instructions PARAMS ((rtx));
static int pa_can_combine_p PARAMS ((rtx, rtx, rtx, int, rtx, rtx, rtx));
@@ -103,11 +99,6 @@ const char *pa_arch_string;
registers which were saved by the current function's prologue. */
static int gr_saved, fr_saved;
-/* The number of the current function for which profile information
- is to be collected. These numbers are used to create unique label
- id's for labels emitted at the beginning of profiled functions. */
-static unsigned int current_function_number = 0;
-
static rtx find_addr_reg PARAMS ((rtx));
/* Keep track of the number of bytes we have output in the CODE subspaces
@@ -3119,16 +3110,6 @@ pa_output_function_prologue (file, size)
fputs ("\n\t.ENTRY\n", file);
- /* When profiling, we need a local label at the beginning of the
- prologue because GAS can't handle the difference of a global symbol
- and a local symbol. */
- if (current_function_profile)
- {
- ASM_OUTPUT_INTERNAL_LABEL (file, FUNC_BEGIN_PROLOG_LABEL,
- current_function_number);
- current_function_number++;
- }
-
/* If we're using GAS and SOM, and not using the portable runtime model,
then we don't need to accumulate the total number of code bytes. */
if ((TARGET_GAS && TARGET_SOM && ! TARGET_PORTABLE_RUNTIME)
@@ -3681,13 +3662,13 @@ hppa_pic_save_rtx ()
void
hppa_profile_hook (label_no)
- int label_no ATTRIBUTE_UNUSED;
+ int label_no;
{
rtx begin_label_rtx, call_insn;
char begin_label_name[16];
ASM_GENERATE_INTERNAL_LABEL (begin_label_name, FUNC_BEGIN_PROLOG_LABEL,
- current_function_number);
+ label_no);
begin_label_rtx = gen_rtx_SYMBOL_REF (Pmode, ggc_strdup (begin_label_name));
if (TARGET_64BIT)
diff --git a/gcc/config/pa/pa.h b/gcc/config/pa/pa.h
index 6977752..0fd97ee 100644
--- a/gcc/config/pa/pa.h
+++ b/gcc/config/pa/pa.h
@@ -939,9 +939,16 @@ extern enum cmp_type hppa_branch_type;
}
/* On HPPA, we emit profiling code as rtl via PROFILE_HOOK rather than
- as assembly via FUNCTION_PROFILER. */
+ as assembly via FUNCTION_PROFILER. Just output a local label.
+ We can't use the function label because the GAS SOM target can't
+ handle the difference of a global symbol and a local symbol. */
-#define FUNCTION_PROFILER(FILE, LABEL) /* nothing */
+#ifndef FUNC_BEGIN_PROLOG_LABEL
+#define FUNC_BEGIN_PROLOG_LABEL "LFBP"
+#endif
+
+#define FUNCTION_PROFILER(FILE, LABEL) \
+ ASM_OUTPUT_INTERNAL_LABEL (FILE, FUNC_BEGIN_PROLOG_LABEL, LABEL)
#define PROFILE_HOOK(label_no) hppa_profile_hook (label_no)
void hppa_profile_hook PARAMS ((int label_no));