summaryrefslogtreecommitdiff
path: root/gcc/config
diff options
context:
space:
mode:
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2001-10-16 22:44:39 +0000
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2001-10-16 22:44:39 +0000
commit8dca7aa11f0eb19de8b9d3228e4ad63cd089bb7e (patch)
tree39d5d2e0186d9240a3eb34846af9b0db26ec0467 /gcc/config
parenta8320faf5bbfde0a8bcb9d910db207209c1c4c7f (diff)
downloadgcc-8dca7aa11f0eb19de8b9d3228e4ad63cd089bb7e.tar.gz
* alpha.c (current_file_function_operand): Don't fail for profiling.
(direct_call_operand): New. * alpha-protos.h: Declare it. * alpha.h (EXTRA_CONSTRAINT): Use it. (PREDICATE_CODES): Add it. (ASM_OUTPUT_MI_THUNK): Remove. * alpha32.h (ASM_OUTPUT_MI_THUNK): Remove. * alpha.md (sibcall_osf_1, sibcall_value_osf_1): Add 's' alternative. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@46299 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config')
-rw-r--r--gcc/config/alpha/alpha-protos.h1
-rw-r--r--gcc/config/alpha/alpha.c33
-rw-r--r--gcc/config/alpha/alpha.h41
-rw-r--r--gcc/config/alpha/alpha.md22
-rw-r--r--gcc/config/alpha/alpha32.h27
5 files changed, 48 insertions, 76 deletions
diff --git a/gcc/config/alpha/alpha-protos.h b/gcc/config/alpha/alpha-protos.h
index 8aae90c565c..e7da7d2e980 100644
--- a/gcc/config/alpha/alpha-protos.h
+++ b/gcc/config/alpha/alpha-protos.h
@@ -56,6 +56,7 @@ extern int some_operand PARAMS ((rtx, enum machine_mode));
extern int some_ni_operand PARAMS ((rtx, enum machine_mode));
extern int input_operand PARAMS ((rtx, enum machine_mode));
extern int current_file_function_operand PARAMS ((rtx, enum machine_mode));
+extern int direct_call_operand PARAMS ((rtx, enum machine_mode));
extern int local_symbolic_operand PARAMS ((rtx, enum machine_mode));
extern int small_symbolic_operand PARAMS ((rtx, enum machine_mode));
extern int global_symbolic_operand PARAMS ((rtx, enum machine_mode));
diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c
index 1b599540cba..48e157e2b08 100644
--- a/gcc/config/alpha/alpha.c
+++ b/gcc/config/alpha/alpha.c
@@ -839,10 +839,35 @@ current_file_function_operand (op, mode)
rtx op;
enum machine_mode mode ATTRIBUTE_UNUSED;
{
- return (GET_CODE (op) == SYMBOL_REF
- && ! profile_flag && ! profile_block_flag
- && (SYMBOL_REF_FLAG (op)
- || op == XEXP (DECL_RTL (current_function_decl), 0)));
+ if (GET_CODE (op) != SYMBOL_REF)
+ return 0;
+
+ if (! SYMBOL_REF_FLAG (op)
+ && op != XEXP (DECL_RTL (current_function_decl), 0))
+ return 0;
+
+ return 1;
+}
+
+/* Return 1 if OP is a SYMBOL_REF for which we can make a call via bsr. */
+
+int
+direct_call_operand (op, mode)
+ rtx op;
+ enum machine_mode mode;
+{
+ /* Must be defined in this file. */
+ if (! current_file_function_operand (op, mode))
+ return 0;
+
+ /* If profiling is implemented via linker tricks, we can't jump
+ to the nogp alternate entry point. */
+ /* ??? TARGET_PROFILING_NEEDS_GP isn't really the right test,
+ but is approximately correct for the OSF ABIs. Don't know
+ what to do for VMS, NT, or UMK. */
+ if (! TARGET_PROFILING_NEEDS_GP
+ && ! profile_flag && ! profile_block_flag)
+ return 0;
}
/* Return true if OP is a LABEL_REF, or SYMBOL_REF or CONST referencing
diff --git a/gcc/config/alpha/alpha.h b/gcc/config/alpha/alpha.h
index 038cb5176a9..d8e4b04a520 100644
--- a/gcc/config/alpha/alpha.h
+++ b/gcc/config/alpha/alpha.h
@@ -824,7 +824,7 @@ enum reg_class { NO_REGS, PV_REG, GENERAL_REGS, FLOAT_REGS, ALL_REGS,
#define EXTRA_CONSTRAINT(OP, C) \
((C) == 'Q' ? normal_memory_operand (OP, VOIDmode) \
- : (C) == 'R' ? current_file_function_operand (OP, Pmode) \
+ : (C) == 'R' ? direct_call_operand (OP, Pmode) \
: (C) == 'S' ? (GET_CODE (OP) == CONST_INT \
&& (unsigned HOST_WIDE_INT) INTVAL (OP) < 64) \
: (C) == 'T' ? GET_CODE (OP) == HIGH \
@@ -2093,44 +2093,6 @@ do { \
#define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 10), \
sprintf ((OUTPUT), "%s.%d", (NAME), (LABELNO)))
-
-/* Output code to add DELTA to the first argument, and then jump to FUNCTION.
- Used for C++ multiple inheritance. */
-/* ??? This is only used with the v2 ABI, and alpha.c makes assumptions
- about current_function_is_thunk that are not valid with the v3 ABI. */
-#if 0
-#define ASM_OUTPUT_MI_THUNK(FILE, THUNK_FNDECL, DELTA, FUNCTION) \
-do { \
- const char *fn_name = XSTR (XEXP (DECL_RTL (FUNCTION), 0), 0); \
- int reg; \
- \
- if (TARGET_ABI_OSF) \
- fprintf (FILE, "\tldgp $29,0($27)\n"); \
- \
- /* Mark end of prologue. */ \
- output_end_prologue (FILE); \
- \
- /* Rely on the assembler to macro expand a large delta. */ \
- fprintf (FILE, "\t.set at\n"); \
- reg = aggregate_value_p (TREE_TYPE (TREE_TYPE (FUNCTION))) ? 17 : 16; \
- fprintf (FILE, "\tlda $%d,%ld($%d)\n", reg, (long)(DELTA), reg); \
- \
- if (current_file_function_operand (XEXP (DECL_RTL (FUNCTION), 0), \
- VOIDmode)) \
- { \
- fprintf (FILE, "\tbr $31,$"); \
- assemble_name (FILE, fn_name); \
- fprintf (FILE, "..ng\n"); \
- } \
- else \
- { \
- fprintf (FILE, "\tjmp $31,"); \
- assemble_name (FILE, fn_name); \
- fputc ('\n', FILE); \
- } \
- fprintf (FILE, "\t.set noat\n"); \
-} while (0)
-#endif
/* Print operand X (an rtx) in assembler syntax to file FILE.
@@ -2188,6 +2150,7 @@ do { \
{"divmod_operator", {DIV, MOD, UDIV, UMOD}}, \
{"fp0_operand", {CONST_DOUBLE}}, \
{"current_file_function_operand", {SYMBOL_REF}}, \
+ {"direct_call_operand", {SYMBOL_REF}}, \
{"local_symbolic_operand", {SYMBOL_REF, CONST, LABEL_REF}}, \
{"small_symbolic_operand", {SYMBOL_REF, CONST}}, \
{"global_symbolic_operand", {SYMBOL_REF, CONST}}, \
diff --git a/gcc/config/alpha/alpha.md b/gcc/config/alpha/alpha.md
index 55f08459353..4eecb1d939f 100644
--- a/gcc/config/alpha/alpha.md
+++ b/gcc/config/alpha/alpha.md
@@ -4848,13 +4848,18 @@ fadd,fmul,fcpys,fdiv,fsqrt,misc,mvi,ftoi,itof,multi"
[(set_attr "type" "jsr")
(set_attr "length" "12,*,16")])
+;; Need 's' alternative for OSF/1, which implements profiling
+;; via linker tricks.
(define_insn "*sibcall_osf_1"
- [(call (mem:DI (match_operand:DI 0 "current_file_function_operand" "R"))
+ [(call (mem:DI (match_operand:DI 0 "current_file_function_operand" "R,s"))
(match_operand 1 "" ""))
(use (reg:DI 29))]
"TARGET_ABI_OSF"
- "br $31,$%0..ng"
- [(set_attr "type" "jsr")])
+ "@
+ br $31,$%0..ng
+ jmp $31,%0"
+ [(set_attr "type" "jsr")
+ (set_attr "length" "*,8")])
(define_insn "*call_nt_1"
[(call (mem:DI (match_operand:DI 0 "call_operand" "r,R,s"))
@@ -6802,14 +6807,19 @@ fadd,fmul,fcpys,fdiv,fsqrt,misc,mvi,ftoi,itof,multi"
[(set_attr "type" "jsr")
(set_attr "length" "12,*,16")])
+;; Need 's' alternative for OSF/1, which implements profiling
+;; via linker tricks.
(define_insn "*sibcall_value_osf_1"
[(set (match_operand 0 "" "")
- (call (mem:DI (match_operand:DI 1 "current_file_function_operand" "R"))
+ (call (mem:DI (match_operand:DI 1 "current_file_function_operand" "R,s"))
(match_operand 2 "" "")))
(use (reg:DI 29))]
"TARGET_ABI_OSF"
- "br $31,$%1..ng"
- [(set_attr "type" "jsr")])
+ "@
+ br $31,$%1..ng
+ jmp $31,%1"
+ [(set_attr "type" "jsr")
+ (set_attr "length" "*,8")])
(define_insn "*call_value_nt_1"
[(set (match_operand 0 "" "")
diff --git a/gcc/config/alpha/alpha32.h b/gcc/config/alpha/alpha32.h
index 8ef83330de1..bb961c2b5a5 100644
--- a/gcc/config/alpha/alpha32.h
+++ b/gcc/config/alpha/alpha32.h
@@ -78,30 +78,3 @@ Boston, MA 02111-1307, USA. */
#undef INITIALIZE_TRAMPOLINE
#define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \
alpha_initialize_trampoline (TRAMP, FNADDR, CXT, 20, 16, 12)
-
-/* Output code to add DELTA to the first argument, and then jump to FUNCTION.
- Used for C++ multiple inheritance. */
-/* ??? This is only used with the v2 ABI, and alpha.c makes assumptions
- about current_function_is_thunk that are not valid with the v3 ABI. */
-#if 0
-#undef ASM_OUTPUT_MI_THUNK
-#define ASM_OUTPUT_MI_THUNK(FILE, THUNK_FNDECL, DELTA, FUNCTION) \
-do { \
- const char *op, *fn_name = XSTR (XEXP (DECL_RTL (FUNCTION), 0), 0); \
- int reg; \
- \
- /* Mark end of prologue. */ \
- output_end_prologue (FILE); \
- \
- /* Rely on the assembler to macro expand a large delta. */ \
- reg = aggregate_value_p (TREE_TYPE (TREE_TYPE (FUNCTION))) ? 17 : 16; \
- fprintf (FILE, "\tlda $%d,%ld($%d)\n", reg, (long)(DELTA), reg); \
- \
- op = "jsr"; \
- if (current_file_function_operand (XEXP (DECL_RTL (FUNCTION), 0))) \
- op = "br"; \
- fprintf (FILE, "\t%s $31,", op); \
- assemble_name (FILE, fn_name); \
- fputc ('\n', FILE); \
-} while (0)
-#endif