aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJohn David Anglin <dave.anglin@nrc-cnrc.gc.ca>2005-10-24 16:51:59 +0000
committerJohn David Anglin <danglin@gcc.gnu.org>2005-10-24 16:51:59 +0000
commit3674b34daf6b281648cc01d31fe85e5d7a5dfe3f (patch)
tree543373aa5e5ab79d3d5d926571f0b8a84fb2e778 /gcc
parent09e87839d4255f7a9fd1c2531efacd7b8b6f33a8 (diff)
downloadgcc-3674b34daf6b281648cc01d31fe85e5d7a5dfe3f.zip
gcc-3674b34daf6b281648cc01d31fe85e5d7a5dfe3f.tar.gz
gcc-3674b34daf6b281648cc01d31fe85e5d7a5dfe3f.tar.bz2
pa-linux.h (NO_PROFILE_COUNTERS): Delete define.
* pa-linux.h (NO_PROFILE_COUNTERS): Delete define. (NO_DEFERRED_PROFILE_COUNTERS): Define. * pa.h (NO_PROFILE_COUNTERS): Define. * pa.c (NO_DEFERRED_PROFILE_COUNTERS): Define if not defined. (funcdef_nos): New vector to hold label numbers of deferred profile counters. (output_deferred_profile_counters): New function. (hppa_profile_hook): Push label number onto funcdef_nos. (pa_hpux_file_end): Call output_deferred_profile_counters if NO_DEFERRED_PROFILE_COUNTERS is false. From-SVN: r105854
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog13
-rw-r--r--gcc/config/pa/pa-linux.h2
-rw-r--r--gcc/config/pa/pa.c41
-rw-r--r--gcc/config/pa/pa.h5
4 files changed, 58 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index d274822..e4e85dd 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,4 +1,15 @@
-2005-10-23 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+2005-10-24 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+
+ * pa-linux.h (NO_PROFILE_COUNTERS): Delete define.
+ (NO_DEFERRED_PROFILE_COUNTERS): Define.
+ * pa.h (NO_PROFILE_COUNTERS): Define.
+ * pa.c (NO_DEFERRED_PROFILE_COUNTERS): Define if not defined.
+ (funcdef_nos): New vector to hold label numbers of deferred profile
+ counters.
+ (output_deferred_profile_counters): New function.
+ (hppa_profile_hook): Push label number onto funcdef_nos.
+ (pa_hpux_file_end): Call output_deferred_profile_counters if
+ NO_DEFERRED_PROFILE_COUNTERS is false.
* pa-protos.h (get_deferred_plabel): New prototype.
* pa.c (get_plabel): Rename to get_deferred_plabel. Return plabel.
diff --git a/gcc/config/pa/pa-linux.h b/gcc/config/pa/pa-linux.h
index 261684f..4115577 100644
--- a/gcc/config/pa/pa-linux.h
+++ b/gcc/config/pa/pa-linux.h
@@ -92,7 +92,7 @@ Boston, MA 02110-1301, USA. */
%{static:-static}}"
/* glibc's profiling functions don't need gcc to allocate counters. */
-#define NO_PROFILE_COUNTERS 1
+#define NO_DEFERRED_PROFILE_COUNTERS 1
/* Define the strings used for the special svr4 .type and .size directives.
These strings generally do not vary from one system running svr4 to
diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c
index adeabed..aa603dc 100644
--- a/gcc/config/pa/pa.c
+++ b/gcc/config/pa/pa.c
@@ -137,6 +137,7 @@ static void pa_linux_file_start (void) ATTRIBUTE_UNUSED;
static void pa_hpux64_gas_file_start (void) ATTRIBUTE_UNUSED;
static void pa_hpux64_hpas_file_start (void) ATTRIBUTE_UNUSED;
static void output_deferred_plabels (void);
+static void output_deferred_profile_counters (void) ATTRIBUTE_UNUSED;
#ifdef ASM_OUTPUT_EXTERNAL_REAL
static void pa_hpux_file_end (void);
#endif
@@ -4141,6 +4142,40 @@ hppa_pic_save_rtx (void)
return get_hard_reg_initial_val (word_mode, PIC_OFFSET_TABLE_REGNUM);
}
+#ifndef NO_DEFERRED_PROFILE_COUNTERS
+#define NO_DEFERRED_PROFILE_COUNTERS 0
+#endif
+
+/* Define heap vector type for funcdef numbers. */
+DEF_VEC_I(int);
+DEF_VEC_ALLOC_I(int,heap);
+
+/* Vector of funcdef numbers. */
+static VEC(int,heap) *funcdef_nos;
+
+/* Output deferred profile counters. */
+static void
+output_deferred_profile_counters (void)
+{
+ unsigned int i;
+ int align, n;
+
+ if (VEC_empty (int, funcdef_nos))
+ return;
+
+ data_section ();
+ align = MIN (BIGGEST_ALIGNMENT, LONG_TYPE_SIZE);
+ ASM_OUTPUT_ALIGN (asm_out_file, floor_log2 (align / BITS_PER_UNIT));
+
+ for (i = 0; VEC_iterate (int, funcdef_nos, i, n); i++)
+ {
+ targetm.asm_out.internal_label (asm_out_file, "LP", n);
+ assemble_integer (const0_rtx, LONG_TYPE_SIZE / BITS_PER_UNIT, align, 1);
+ }
+
+ VEC_free (int, heap, funcdef_nos);
+}
+
void
hppa_profile_hook (int label_no)
{
@@ -4175,11 +4210,12 @@ hppa_profile_hook (int label_no)
emit_insn (gen_load_offset_label_address (gen_rtx_REG (SImode, 25),
reg, begin_label_rtx, label_rtx));
-#ifndef NO_PROFILE_COUNTERS
+#if !NO_DEFERRED_PROFILE_COUNTERS
{
rtx count_label_rtx, addr, r24;
char count_label_name[16];
+ VEC_safe_push (int, heap, funcdef_nos, label_no);
ASM_GENERATE_INTERNAL_LABEL (count_label_name, "LP", label_no);
count_label_rtx = gen_rtx_SYMBOL_REF (Pmode, ggc_strdup (count_label_name));
@@ -9158,6 +9194,9 @@ pa_hpux_file_end (void)
unsigned int i;
extern_symbol *p;
+ if (!NO_DEFERRED_PROFILE_COUNTERS)
+ output_deferred_profile_counters ();
+
output_deferred_plabels ();
for (i = 0; VEC_iterate (extern_symbol, extern_symbols, i, p); i++)
diff --git a/gcc/config/pa/pa.h b/gcc/config/pa/pa.h
index d56ebcf..fa43828 100644
--- a/gcc/config/pa/pa.h
+++ b/gcc/config/pa/pa.h
@@ -769,6 +769,11 @@ void hppa_profile_hook (int label_no);
/* The profile counter if emitted must come before the prologue. */
#define PROFILE_BEFORE_PROLOGUE 1
+/* We never want final.c to emit profile counters. When profile
+ counters are required, we have to defer emitting them to the end
+ of the current file. */
+#define NO_PROFILE_COUNTERS 1
+
/* 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.