(emit_call_1): Add REG_ALWAYS_RETURN note if needed.
(expand_call): Use LCF_ALWAYS_RETURN for __bb_fork_func.
(emit_library_call_value_1): Handle LCT_ALWAYS_RETRUN.
* flow.c (need_fake_edge_p): Handle REG_ALWAYS_RETURN.
* rtl.c (reg_note_name): New name.
* rtl.h (enum reg_note): Add REG_ALWAYS_RETURN.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@44722
138bc75d-0d04-0410-961f-
82ee72b054a4
+Wed Aug 8 21:06:43 CEST 2001 Jan Hubicka <jh@suse.cz>
+
+ * calls.c (ECF_ALWAYS_RETURN): New constant.
+ (emit_call_1): Add REG_ALWAYS_RETURN note if needed.
+ (expand_call): Use LCF_ALWAYS_RETURN for __bb_fork_func.
+ (emit_library_call_value_1): Handle LCT_ALWAYS_RETRUN.
+ * flow.c (need_fake_edge_p): Handle REG_ALWAYS_RETURN.
+ * rtl.c (reg_note_name): New name.
+ * rtl.h (enum reg_note): Add REG_ALWAYS_RETURN.
+
2001-08-07 Aldy Hernandez <aldyh@redhat.com>
* config/mips/mips.c (mips_legitimate_address_p): Limit "la" addresses.
/* Nonzero if this is a call to a function that returns with the stack
pointer depressed. */
#define ECF_SP_DEPRESSED 1024
+/* Nonzero if this call is known to always return. */
+#define ECF_ALWAYS_RETURN 2048
static void emit_call_1 PARAMS ((rtx, tree, tree, HOST_WIDE_INT,
HOST_WIDE_INT, HOST_WIDE_INT, rtx,
if (ecf_flags & ECF_NORETURN)
REG_NOTES (call_insn) = gen_rtx_EXPR_LIST (REG_NORETURN, const0_rtx,
REG_NOTES (call_insn));
+ if (ecf_flags & ECF_ALWAYS_RETURN)
+ REG_NOTES (call_insn) = gen_rtx_EXPR_LIST (REG_ALWAYS_RETURN, const0_rtx,
+ REG_NOTES (call_insn));
if (ecf_flags & ECF_RETURNS_TWICE)
REG_NOTES (call_insn) = gen_rtx_EXPR_LIST (REG_SETJMP, const0_rtx,
is subject to race conditions, just as with multithreaded
programs. */
- emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__bb_fork_func"), 0,
+ emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__bb_fork_func"),
+ LCT_ALWAYS_RETURN,
VOIDmode, 0);
}
case LCT_THROW:
flags = ECF_NORETURN;
break;
+ case LCT_ALWAYS_RETURN:
+ flags = ECF_ALWAYS_RETURN;
+ break;
}
fun = orgfun;
if ((GET_CODE (insn) == CALL_INSN
&& !SIBLING_CALL_P (insn)
&& !find_reg_note (insn, REG_NORETURN, NULL)
+ && !find_reg_note (insn, REG_ALWAYS_RETURN, NULL)
&& !CONST_OR_PURE_CALL_P (insn)))
return true;
"REG_EXEC_COUNT", "REG_NOALIAS", "REG_SAVE_AREA", "REG_BR_PRED",
"REG_FRAME_RELATED_EXPR", "REG_EH_CONTEXT", "REG_EH_REGION",
"REG_EH_RETHROW", "REG_SAVE_NOTE", "REG_MAYBE_DEAD", "REG_NORETURN",
- "REG_NON_LOCAL_GOTO", "REG_SETJMP"
+ "REG_NON_LOCAL_GOTO", "REG_SETJMP", "REG_ALWAYS_RETURN"
};
\f
/* This kind of note is generated at each to `setjmp',
and similar functions that can return twice. */
- REG_SETJMP
+ REG_SETJMP,
+
+ /* Indicate calls that always returns. */
+ REG_ALWAYS_RETURN
};
/* The base value for branch probability notes. */
LCT_CONST_MAKE_BLOCK = 3,
LCT_PURE_MAKE_BLOCK = 4,
LCT_NORETURN = 5,
- LCT_THROW = 6
+ LCT_THROW = 6,
+ LCT_ALWAYS_RETURN = 7
};
extern void emit_library_call PARAMS ((rtx, enum libcall_type,