summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Henderson <rth@gcc.gnu.org>2000-03-17 14:41:25 -0800
committerRichard Henderson <rth@gcc.gnu.org>2000-03-17 14:41:25 -0800
commit7d89dda571403fb5293782e4786738ef189b85b3 (patch)
treee89f540fe7d82fee86df999b089ca77b84259940 /gcc
parent0a1c58a25ab5df1a3e4596024774641ebae8be2a (diff)
downloadgcc-7d89dda571403fb5293782e4786738ef189b85b3.tar.gz
alpha.h (FUNCTION_OK_FOR_SIBCALL): New.
* alpha.h (FUNCTION_OK_FOR_SIBCALL): New. * alpha.md (sibcall, sibcall_value, sibcall_epilogue): New. (*sibcall_osf_1, *sibcall_value_osf_1): New. From-SVN: r32613
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog12
-rw-r--r--gcc/config/alpha/alpha.h10
-rw-r--r--gcc/config/alpha/alpha.md62
3 files changed, 73 insertions, 11 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 3ac1d635426..84cd1bb8810 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -52,6 +52,10 @@
(safe_for_unsave): New.
* tree.h (lang_safe_for_unsave, safe_for_unsave): Declare.
+ * alpha.h (FUNCTION_OK_FOR_SIBCALL): New.
+ * alpha.md (sibcall, sibcall_value, sibcall_epilogue): New.
+ (*sibcall_osf_1, *sibcall_value_osf_1): New.
+
2000-03-17 Mark Mitchell <mark@codesourcery.com>
* objc/objc-act.c (encode_method_prototype): Pass types, not
@@ -214,7 +218,7 @@ Thu Mar 16 09:02:19 2000 Jason Eckhardt <jle@cygnus.com>
2000-03-16 Neil Booth <NeilB@earthling.net>
* cppinit.c (handle_option): Implement #unassert directive
- as -A- command line option.
+ as -A- command line option.
(print_help): Update.
* cpptexi.c: Update.
@@ -298,9 +302,9 @@ Wed Mar 15 13:07:05 MET 2000 Jan Hubicka <jh@suse.cz>
Wed Feb 23 13:00:06 CET 2000 Jan Hubicka <jh@suse.cz>
- * flow.c (fixup_reorder_chain): Avoid double labels in the basic block;
- end of basic block is jump_insn, not barrier; use create_basic_block
- instead of creating basic block by hand.
+ * flow.c (fixup_reorder_chain): Avoid double labels in the basic block;
+ end of basic block is jump_insn, not barrier; use create_basic_block
+ instead of creating basic block by hand.
2000-03-14 Jason Eckhardt <jle@cygnus.com>
diff --git a/gcc/config/alpha/alpha.h b/gcc/config/alpha/alpha.h
index 40717ac9549..15a4b31eef6 100644
--- a/gcc/config/alpha/alpha.h
+++ b/gcc/config/alpha/alpha.h
@@ -1168,6 +1168,16 @@ extern int alpha_memory_latency;
} \
}
+/* We do not allow indirect calls to be optimized into sibling calls, nor
+ can we allow a call to a function in a different compilation unit to
+ be optimized into a sibcall. Except if the function is known not to
+ return, in which case our caller doesn't care what the gp is. */
+#define FUNCTION_OK_FOR_SIBCALL(DECL) \
+ (DECL \
+ && ((TREE_ASM_WRITTEN (DECL) && !flag_pic) \
+ || ! TREE_PUBLIC (DECL) \
+ || (0 && TREE_THIS_VOLATILE (DECL))))
+
/* Try to output insns to set TARGET equal to the constant C if it can be
done in less than N insns. Do all computations in MODE. Returns the place
where the output has been placed if it can be done and the insns have been
diff --git a/gcc/config/alpha/alpha.md b/gcc/config/alpha/alpha.md
index ed4abe069a3..edba8cfbd93 100644
--- a/gcc/config/alpha/alpha.md
+++ b/gcc/config/alpha/alpha.md
@@ -3704,6 +3704,17 @@
DONE;
}")
+(define_expand "sibcall"
+ [(call (mem:DI (match_operand 0 "" ""))
+ (match_operand 1 "" ""))]
+ "!TARGET_OPEN_VMS && !TARGET_WINDOWS_NT"
+ "
+{
+ if (GET_CODE (operands[0]) != MEM)
+ abort ();
+ operands[0] = XEXP (operands[0], 0);
+}")
+
(define_expand "call_osf"
[(parallel [(call (mem:DI (match_operand 0 "" ""))
(match_operand 1 "" ""))
@@ -3815,6 +3826,18 @@
DONE;
}")
+(define_expand "sibcall_value"
+ [(set (match_operand 0 "" "")
+ (call (mem:DI (match_operand 1 "" ""))
+ (match_operand 2 "" "")))]
+ "!TARGET_OPEN_VMS && !TARGET_WINDOWS_NT"
+ "
+{
+ if (GET_CODE (operands[1]) != MEM)
+ abort ();
+ operands[1] = XEXP (operands[1], 0);
+}")
+
(define_expand "call_value_osf"
[(parallel [(set (match_operand 0 "" "")
(call (mem:DI (match_operand 1 "" ""))
@@ -3903,7 +3926,7 @@
}
}")
-(define_insn ""
+(define_insn "*call_osf_1"
[(call (mem:DI (match_operand:DI 0 "call_operand" "r,R,i"))
(match_operand 1 "" ""))
(clobber (reg:DI 27))
@@ -3916,7 +3939,17 @@
[(set_attr "type" "jsr")
(set_attr "length" "12,*,16")])
-(define_insn ""
+(define_insn "*sibcall_osf_1"
+ [(call (mem:DI (match_operand:DI 0 "call_operand" "R,i"))
+ (match_operand 1 "" ""))]
+ "! TARGET_WINDOWS_NT && ! TARGET_OPEN_VMS"
+ "@
+ 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,i"))
(match_operand 1 "" ""))
(clobber (reg:DI 26))]
@@ -3928,7 +3961,7 @@
[(set_attr "type" "jsr")
(set_attr "length" "*,*,12")])
-(define_insn ""
+(define_insn "*call_vms_1"
[(call (mem:DI (match_operand:DI 0 "call_operand" "r,i"))
(match_operand 1 "" ""))
(use (match_operand:DI 2 "nonimmediate_operand" "r,m"))
@@ -5434,6 +5467,11 @@
""
"alpha_expand_epilogue ();")
+(define_expand "sibcall_epilogue"
+ [(return)]
+ "!TARGET_OPEN_VMS && !TARGET_WINDOWS_NT"
+ "alpha_expand_epilogue (); DONE;")
+
(define_expand "eh_epilogue"
[(use (match_operand:DI 0 "register_operand" "r"))
(use (match_operand:DI 1 "register_operand" "r"))
@@ -5576,7 +5614,7 @@
;; The call patterns are at the end of the file because their
;; wildcard operand0 interferes with nice recognition.
-(define_insn ""
+(define_insn "*call_value_osf_1"
[(set (match_operand 0 "" "")
(call (mem:DI (match_operand:DI 1 "call_operand" "r,R,i"))
(match_operand 2 "" "")))
@@ -5590,7 +5628,18 @@
[(set_attr "type" "jsr")
(set_attr "length" "12,*,16")])
-(define_insn ""
+(define_insn "*sibcall_value_osf_1"
+ [(set (match_operand 0 "" "")
+ (call (mem:DI (match_operand:DI 1 "call_operand" "R,i"))
+ (match_operand 2 "" "")))]
+ "! TARGET_WINDOWS_NT && ! TARGET_OPEN_VMS"
+ "@
+ 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 "" "")
(call (mem:DI (match_operand:DI 1 "call_operand" "r,R,i"))
(match_operand 2 "" "")))
@@ -5603,7 +5652,7 @@
[(set_attr "type" "jsr")
(set_attr "length" "*,*,12")])
-(define_insn ""
+(define_insn "*call_value_vms_1"
[(set (match_operand 0 "" "")
(call (mem:DI (match_operand:DI 1 "call_operand" "r,i"))
(match_operand 2 "" "")))
@@ -5617,7 +5666,6 @@
ldq $27,%3\;jsr $26,%1\;ldq $27,0($29)"
[(set_attr "type" "jsr")
(set_attr "length" "12,16")])
-
;; Peepholes go at the end.