summaryrefslogtreecommitdiff
path: root/gcc/config/pa
diff options
context:
space:
mode:
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2002-05-19 07:55:48 +0000
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2002-05-19 07:55:48 +0000
commit7b4a38a6036e7a17bf0c302f77c31a6a27ab0ca9 (patch)
tree4ddec3992557b6c2d8d93182967d4ae32a004621 /gcc/config/pa
parent6a30c708faaf739f972849a41f01c2a3ab640c43 (diff)
downloadgcc-7b4a38a6036e7a17bf0c302f77c31a6a27ab0ca9.tar.gz
* system.h (STRIP_NAME_ENCODING): Poison it.
* output.h (STRIP_NAME_ENCODING): Remove. (default_strip_name_encoding): Declare. * target-def.h (TARGET_STRIP_NAME_ENCODING): New. * target.h (strip_name_encoding): New. * varasm.c (default_strip_name_encoding): New. * dwarf2asm.c, varasm.c, config/darwin.c, config/darwin.h, config/alpha/alpha.c, config/arm/pe.c, config/avr/avr.c, config/cris/cris.c, config/i386/cygwin.h, config/i386/interix.c, config/i386/winnt.c, config/m32r/m32r.h, config/mcore/mcore-elf.h, config/mcore/mcore-pe.h, config/mcore/mcore.c, config/mcore/mcore.h, config/mips/mips.c, config/mn10200/mn10200.h, config/mn10300/mn10300.h, config/pa/pa.c, config/pa/pa.h, config/pa/som.h, config/rs6000/rs6000.c, config/rs6000/sysv4.h, config/rs6000/xcoff.h, config/v850/v850.h: Use the hook, not the macro. * config/darwin-protos.h, config/darwin.c, config/darwin.h, config/alpha/alpha.c, config/alpha/alpha.h, config/h8300/h8300.c, config/h8300/h8300.h, config/i386/cygwin.h, config/i386/i386-interix.h, config/i386/i386-protos.h, config/i386/win32.h, config/i386/winnt.c, config/ia64/ia64.c, config/ia64/ia64.h, config/m32r/m32r.c, config/m32r/m32r.h, config/mcore/mcore.c, config/mcore/mcore.h, config/pa/pa.c, config/rs6000/rs6000.c, config/rs6000/sysv4.h, config/rs6000/xcoff.h, config/sh/sh.c, config/sh/sh.h, config/v850/v850.c, config/v850/v850.h: Move STRIP_NAME_ENCODING to out-of-line function and add TARGET_STRIP_NAME_ENCODING. * config/arm/arm.c, config/arm/arm.h, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mmix/mmix.h: Replace STRIP_NAME_ENCODING with TARGET_STRIP_NAME_ENCODING referencing existing function; make function static. * xcoffout.c: Include target.h * Makefile.in (xcoffout.o): Update. * config/avr/avr.c (avr_encode_section_info): Correct prototype. * config/avr/avr.h (STRIP_NAME_ENCODING): Remove. * config/rs6000/rs6000.c (rs6000_xcoff_unique_section): Mark reloc argument unused. * config/sh/sh.c (TARGET_ENCODE_SECTION_INFO): New. * doc/tm.texi (TARGET_STRIP_NAME_ENCODING): Update from previous STRIP_NAME_ENCODING docs. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@53615 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/pa')
-rw-r--r--gcc/config/pa/pa.c14
-rw-r--r--gcc/config/pa/pa.h150
-rw-r--r--gcc/config/pa/som.h5
3 files changed, 87 insertions, 82 deletions
diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c
index d12c1be910a..41e5dc05c78 100644
--- a/gcc/config/pa/pa.c
+++ b/gcc/config/pa/pa.c
@@ -117,6 +117,7 @@ static int pa_issue_rate PARAMS ((void));
static void pa_select_section PARAMS ((tree, int, unsigned HOST_WIDE_INT))
ATTRIBUTE_UNUSED;
static void pa_encode_section_info PARAMS ((tree, int));
+static const char *pa_strip_name_encoding PARAMS ((const char *));
/* Save the operands last given to a compare for use when we
generate a scc or bcc insn. */
@@ -188,6 +189,8 @@ int n_deferred_plabels = 0;
#undef TARGET_ENCODE_SECTION_INFO
#define TARGET_ENCODE_SECTION_INFO pa_encode_section_info
+#undef TARGET_STRIP_NAME_ENCODING
+#define TARGET_STRIP_NAME_ENCODING pa_strip_name_encoding
struct gcc_target targetm = TARGET_INITIALIZER;
@@ -6285,7 +6288,7 @@ output_call (insn, call_dest, sibcall)
/* Gross. We have just implicitly taken the address of this
function, mark it as such. */
- STRIP_NAME_ENCODING (real_name, name);
+ real_name = (*targetm.strip_name_encoding) (name);
TREE_SYMBOL_REFERENCED (get_identifier (real_name)) = 1;
}
@@ -6460,6 +6463,15 @@ pa_encode_section_info (decl, first)
}
}
+/* This is sort of inverse to pa_encode_section_info. */
+
+static const char *
+pa_strip_name_encoding (str)
+ const char *str;
+{
+ return str + (*str == '*' || *str == '@');
+}
+
int
function_label_operand (op, mode)
rtx op;
diff --git a/gcc/config/pa/pa.h b/gcc/config/pa/pa.h
index 55e4311b1a3..8f432c2cc0e 100644
--- a/gcc/config/pa/pa.h
+++ b/gcc/config/pa/pa.h
@@ -864,79 +864,80 @@ struct hppa_args {int words, nargs_prototype, indirect; };
extern struct rtx_def *hppa_compare_op0, *hppa_compare_op1;
extern enum cmp_type hppa_branch_type;
-#define ASM_OUTPUT_MI_THUNK(FILE, THUNK_FNDECL, DELTA, FUNCTION) \
-{ const char *target_name = XSTR (XEXP (DECL_RTL (FUNCTION), 0), 0); \
- static unsigned int current_thunk_number; \
- char label[16]; \
- char *lab; \
- ASM_GENERATE_INTERNAL_LABEL (label, "LTHN", current_thunk_number); \
- STRIP_NAME_ENCODING (lab, label); \
- STRIP_NAME_ENCODING (target_name, target_name); \
- /* FIXME: total_code_bytes is not handled correctly in files with \
- mi thunks. */ \
- pa_output_function_prologue (FILE, 0); \
- if (VAL_14_BITS_P (DELTA)) \
- { \
- if (! TARGET_64BIT && ! TARGET_PORTABLE_RUNTIME && flag_pic) \
- { \
- fprintf (FILE, "\taddil LT%%%s,%%r19\n", lab); \
- fprintf (FILE, "\tldw RT%%%s(%%r1),%%r22\n", lab); \
- fprintf (FILE, "\tldw 0(%%sr0,%%r22),%%r22\n"); \
- fprintf (FILE, "\tbb,>=,n %%r22,30,.+16\n"); \
- fprintf (FILE, "\tdepi 0,31,2,%%r22\n"); \
- fprintf (FILE, "\tldw 4(%%sr0,%%r22),%%r19\n"); \
- fprintf (FILE, "\tldw 0(%%sr0,%%r22),%%r22\n"); \
+#define ASM_OUTPUT_MI_THUNK(FILE, THUNK_FNDECL, DELTA, FUNCTION) \
+do { \
+ const char *target_name = XSTR (XEXP (DECL_RTL (FUNCTION), 0), 0); \
+ static unsigned int current_thunk_number; \
+ char label[16]; \
+ char *lab; \
+ ASM_GENERATE_INTERNAL_LABEL (label, "LTHN", current_thunk_number); \
+ lab = (*targetm.strip_name_encoding) (label); \
+ target_name = (*targetm.strip_name_encoding) (target_name); \
+ /* FIXME: total_code_bytes is not handled correctly in files with \
+ mi thunks. */ \
+ pa_output_function_prologue (FILE, 0); \
+ if (VAL_14_BITS_P (DELTA)) \
+ { \
+ if (! TARGET_64BIT && ! TARGET_PORTABLE_RUNTIME && flag_pic) \
+ { \
+ fprintf (FILE, "\taddil LT%%%s,%%r19\n", lab); \
+ fprintf (FILE, "\tldw RT%%%s(%%r1),%%r22\n", lab); \
+ fprintf (FILE, "\tldw 0(%%sr0,%%r22),%%r22\n"); \
+ fprintf (FILE, "\tbb,>=,n %%r22,30,.+16\n"); \
+ fprintf (FILE, "\tdepi 0,31,2,%%r22\n"); \
+ fprintf (FILE, "\tldw 4(%%sr0,%%r22),%%r19\n"); \
+ fprintf (FILE, "\tldw 0(%%sr0,%%r22),%%r22\n"); \
fprintf (FILE, "\tldsid (%%sr0,%%r22),%%r1\n\tmtsp %%r1,%%sr0\n"); \
- fprintf (FILE, "\tbe 0(%%sr0,%%r22)\n\tldo "); \
- fprintf (FILE, HOST_WIDE_INT_PRINT_DEC, DELTA); \
- fprintf (FILE, "(%%r26),%%r26\n"); \
- } \
- else \
- { \
- fprintf (FILE, "\tb %s\n\tldo ", target_name); \
- fprintf (FILE, HOST_WIDE_INT_PRINT_DEC, DELTA); \
- fprintf (FILE, "(%%r26),%%r26\n"); \
- } \
- } \
- else \
- { \
- if (! TARGET_64BIT && ! TARGET_PORTABLE_RUNTIME && flag_pic) \
- { \
- fprintf (FILE, "\taddil L%%"); \
- fprintf (FILE, HOST_WIDE_INT_PRINT_DEC, DELTA); \
- fprintf (FILE, ",%%r26\n\tldo R%%"); \
- fprintf (FILE, HOST_WIDE_INT_PRINT_DEC, DELTA); \
- fprintf (FILE, "(%%r1),%%r26\n"); \
- fprintf (FILE, "\taddil LT%%%s,%%r19\n", lab); \
- fprintf (FILE, "\tldw RT%%%s(%%r1),%%r22\n", lab); \
- fprintf (FILE, "\tldw 0(%%sr0,%%r22),%%r22\n"); \
- fprintf (FILE, "\tbb,>=,n %%r22,30,.+16\n"); \
- fprintf (FILE, "\tdepi 0,31,2,%%r22\n"); \
- fprintf (FILE, "\tldw 4(%%sr0,%%r22),%%r19\n"); \
- fprintf (FILE, "\tldw 0(%%sr0,%%r22),%%r22\n"); \
+ fprintf (FILE, "\tbe 0(%%sr0,%%r22)\n\tldo "); \
+ fprintf (FILE, HOST_WIDE_INT_PRINT_DEC, DELTA); \
+ fprintf (FILE, "(%%r26),%%r26\n"); \
+ } \
+ else \
+ { \
+ fprintf (FILE, "\tb %s\n\tldo ", target_name); \
+ fprintf (FILE, HOST_WIDE_INT_PRINT_DEC, DELTA); \
+ fprintf (FILE, "(%%r26),%%r26\n"); \
+ } \
+ } \
+ else \
+ { \
+ if (! TARGET_64BIT && ! TARGET_PORTABLE_RUNTIME && flag_pic) \
+ { \
+ fprintf (FILE, "\taddil L%%"); \
+ fprintf (FILE, HOST_WIDE_INT_PRINT_DEC, DELTA); \
+ fprintf (FILE, ",%%r26\n\tldo R%%"); \
+ fprintf (FILE, HOST_WIDE_INT_PRINT_DEC, DELTA); \
+ fprintf (FILE, "(%%r1),%%r26\n"); \
+ fprintf (FILE, "\taddil LT%%%s,%%r19\n", lab); \
+ fprintf (FILE, "\tldw RT%%%s(%%r1),%%r22\n", lab); \
+ fprintf (FILE, "\tldw 0(%%sr0,%%r22),%%r22\n"); \
+ fprintf (FILE, "\tbb,>=,n %%r22,30,.+16\n"); \
+ fprintf (FILE, "\tdepi 0,31,2,%%r22\n"); \
+ fprintf (FILE, "\tldw 4(%%sr0,%%r22),%%r19\n"); \
+ fprintf (FILE, "\tldw 0(%%sr0,%%r22),%%r22\n"); \
fprintf (FILE, "\tldsid (%%sr0,%%r22),%%r1\n\tmtsp %%r1,%%sr0\n"); \
- fprintf (FILE, "\tbe,n 0(%%sr0,%%r22)\n"); \
- } \
- else \
- { \
- fprintf (FILE, "\taddil L%%"); \
- fprintf (FILE, HOST_WIDE_INT_PRINT_DEC, DELTA); \
- fprintf (FILE, ",%%r26\n\tb %s\n\tldo R%%", target_name); \
- fprintf (FILE, HOST_WIDE_INT_PRINT_DEC, DELTA); \
- fprintf (FILE, "(%%r1),%%r26\n"); \
- } \
- } \
- fprintf (FILE, "\t.EXIT\n\t.PROCEND\n"); \
- if (! TARGET_64BIT && ! TARGET_PORTABLE_RUNTIME && flag_pic) \
- { \
- data_section (); \
- fprintf (FILE, "\t.align 4\n"); \
- ASM_OUTPUT_INTERNAL_LABEL (FILE, "LTHN", current_thunk_number); \
- fprintf (FILE, "\t.word P%%%s\n", target_name); \
- function_section (THUNK_FNDECL); \
- } \
- current_thunk_number++; \
-}
+ fprintf (FILE, "\tbe,n 0(%%sr0,%%r22)\n"); \
+ } \
+ else \
+ { \
+ fprintf (FILE, "\taddil L%%"); \
+ fprintf (FILE, HOST_WIDE_INT_PRINT_DEC, DELTA); \
+ fprintf (FILE, ",%%r26\n\tb %s\n\tldo R%%", target_name); \
+ fprintf (FILE, HOST_WIDE_INT_PRINT_DEC, DELTA); \
+ fprintf (FILE, "(%%r1),%%r26\n"); \
+ } \
+ } \
+ fprintf (FILE, "\t.EXIT\n\t.PROCEND\n"); \
+ if (! TARGET_64BIT && ! TARGET_PORTABLE_RUNTIME && flag_pic) \
+ { \
+ data_section (); \
+ fprintf (FILE, "\t.align 4\n"); \
+ ASM_OUTPUT_INTERNAL_LABEL (FILE, "LTHN", current_thunk_number); \
+ fprintf (FILE, "\t.word P%%%s\n", target_name); \
+ function_section (THUNK_FNDECL); \
+ } \
+ current_thunk_number++; \
+} while (0)
/* On HPPA, we emit profiling code as rtl via PROFILE_HOOK rather than
as assembly via FUNCTION_PROFILER. Just output a local label.
@@ -1522,13 +1523,6 @@ do { \
#define FUNCTION_NAME_P(NAME) (*(NAME) == '@')
-/* Store the user-specified part of SYMBOL_NAME in VAR.
- This is sort of inverse to targetm.encode_section_info. */
-
-#define STRIP_NAME_ENCODING(VAR,SYMBOL_NAME) \
- (VAR) = ((SYMBOL_NAME) \
- + (*(SYMBOL_NAME) == '*' || *(SYMBOL_NAME) == '@'))
-
/* Specify the machine mode that this machine uses
for the index in the tablejump instruction. */
#define CASE_VECTOR_MODE (TARGET_BIG_SWITCH ? TImode : DImode)
diff --git a/gcc/config/pa/som.h b/gcc/config/pa/som.h
index 7c17ff6b810..9f0a964f32d 100644
--- a/gcc/config/pa/som.h
+++ b/gcc/config/pa/som.h
@@ -131,8 +131,7 @@ do { \
that the section name will have a "." prefix. */
#define ASM_OUTPUT_FUNCTION_PREFIX(FILE, NAME) \
{ \
- const char *name; \
- STRIP_NAME_ENCODING (name, NAME); \
+ const char *name = (*targetm.strip_name_encoding) (NAME); \
if (TARGET_GAS && in_section == in_text) \
fputs ("\t.NSUBSPA $CODE$,QUAD=0,ALIGN=8,ACCESS=44,CODE_ONLY\n", FILE); \
else if (TARGET_GAS) \
@@ -335,7 +334,7 @@ readonly_data () \
if (!function_label_operand (RTL, VOIDmode)) \
hppa_encode_label (RTL); \
\
- STRIP_NAME_ENCODING (name, XSTR ((RTL), 0)); \
+ name = (*targetm.strip_name_encoding) (XSTR ((RTL), 0)); \
id = maybe_get_identifier (name); \
if (! id || ! TREE_SYMBOL_REFERENCED (id)) \
{ \