Commit 9a1ba437 by Richard Henderson Committed by Richard Henderson

calls.c (expand_call): Disallow sibcalls to noreturn functions.

        * calls.c (expand_call): Disallow sibcalls to noreturn functions.
        * flow.c (make_edges): Revert last change.

        * config/alpha/alpha.h (FUNCTION_OK_FOR_SIBCALL): Don't test
        TREE_THIS_VOLATILE.
        * config/pa/pa.h (FUNCTION_OK_FOR_SIBCALL): Likewise.

From-SVN: r36781
parent 9ab916b8
2000-10-07 Richard Henderson <rth@cygnus.com>
* calls.c (expand_call): Disallow sibcalls to noreturn functions.
* flow.c (make_edges): Revert last change.
* config/alpha/alpha.h (FUNCTION_OK_FOR_SIBCALL): Don't test
TREE_THIS_VOLATILE.
* config/pa/pa.h (FUNCTION_OK_FOR_SIBCALL): Likewise.
2000-10-06 David O'Brien <obrien@dragon.nuxi.com> 2000-10-06 David O'Brien <obrien@dragon.nuxi.com>
* config/alpha/elf.h: Standardize the formatting. * config/alpha/elf.h: Standardize the formatting.
......
...@@ -2463,6 +2463,7 @@ expand_call (exp, target, ignore) ...@@ -2463,6 +2463,7 @@ expand_call (exp, target, ignore)
before the sibcall_epilogue. */ before the sibcall_epilogue. */
|| fndecl == NULL_TREE || fndecl == NULL_TREE
|| (flags & (ECF_RETURNS_TWICE | ECF_LONGJMP)) || (flags & (ECF_RETURNS_TWICE | ECF_LONGJMP))
|| TREE_THIS_VOLATILE (fndecl)
|| !FUNCTION_OK_FOR_SIBCALL (fndecl) || !FUNCTION_OK_FOR_SIBCALL (fndecl)
/* If this function requires more stack slots than the current /* If this function requires more stack slots than the current
function, we cannot change it into a sibling call. */ function, we cannot change it into a sibling call. */
......
...@@ -1187,8 +1187,7 @@ extern int alpha_memory_latency; ...@@ -1187,8 +1187,7 @@ extern int alpha_memory_latency;
#define FUNCTION_OK_FOR_SIBCALL(DECL) \ #define FUNCTION_OK_FOR_SIBCALL(DECL) \
(DECL \ (DECL \
&& ((TREE_ASM_WRITTEN (DECL) && !flag_pic) \ && ((TREE_ASM_WRITTEN (DECL) && !flag_pic) \
|| ! TREE_PUBLIC (DECL) \ || ! TREE_PUBLIC (DECL)))
|| (0 && TREE_THIS_VOLATILE (DECL))))
/* Try to output insns to set TARGET equal to the constant C if it can be /* 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 done in less than N insns. Do all computations in MODE. Returns the place
......
...@@ -2014,8 +2014,7 @@ while (0) ...@@ -2014,8 +2014,7 @@ while (0)
#define FUNCTION_OK_FOR_SIBCALL(DECL) \ #define FUNCTION_OK_FOR_SIBCALL(DECL) \
(DECL \ (DECL \
&& ! TARGET_64BIT \ && ! TARGET_64BIT \
&& (! TREE_PUBLIC (DECL) \ && ! TREE_PUBLIC (DECL))
|| TREE_THIS_VOLATILE (DECL)))
#define PREDICATE_CODES \ #define PREDICATE_CODES \
{"reg_or_0_operand", {SUBREG, REG, CONST_INT}}, \ {"reg_or_0_operand", {SUBREG, REG, CONST_INT}}, \
......
...@@ -1152,12 +1152,8 @@ make_edges (label_value_list) ...@@ -1152,12 +1152,8 @@ make_edges (label_value_list)
wouldn't have created the sibling call in the first place. */ wouldn't have created the sibling call in the first place. */
if (code == CALL_INSN && SIBLING_CALL_P (insn)) if (code == CALL_INSN && SIBLING_CALL_P (insn))
{ make_edge (edge_cache, bb, EXIT_BLOCK_PTR,
if (! find_reg_note (insn, REG_NORETURN, NULL_RTX)) EDGE_ABNORMAL | EDGE_ABNORMAL_CALL);
make_edge (edge_cache, bb, EXIT_BLOCK_PTR,
EDGE_ABNORMAL | EDGE_ABNORMAL_CALL);
}
else
/* If this is a CALL_INSN, then mark it as reaching the active EH /* If this is a CALL_INSN, then mark it as reaching the active EH
handler for this CALL_INSN. If we're handling asynchronous handler for this CALL_INSN. If we're handling asynchronous
...@@ -1165,7 +1161,7 @@ make_edges (label_value_list) ...@@ -1165,7 +1161,7 @@ make_edges (label_value_list)
Also mark the CALL_INSN as reaching any nonlocal goto handler. */ Also mark the CALL_INSN as reaching any nonlocal goto handler. */
if (code == CALL_INSN || asynchronous_exceptions) else if (code == CALL_INSN || asynchronous_exceptions)
{ {
/* Add any appropriate EH edges. We do this unconditionally /* Add any appropriate EH edges. We do this unconditionally
since there may be a REG_EH_REGION or REG_EH_RETHROW note since there may be a REG_EH_REGION or REG_EH_RETHROW note
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment