From 16465ceb06cc1f65cfca3c0eb2c1ee27ab03bdfd Mon Sep 17 00:00:00 2001 From: liuhongt Date: Tue, 1 Jun 2021 09:00:57 +0800 Subject: CALL_INSN may not be a real function call. Use "used" flag for CALL_INSN to indicate it's a fake call. If it's a fake call, it won't have its own function stack. gcc/ChangeLog PR target/82735 * df-scan.c (df_get_call_refs): When call_insn is a fake call, it won't use stack pointer reg. * final.c (leaf_function_p): When call_insn is a fake call, it won't affect caller as a leaf function. * reg-stack.c (callee_clobbers_any_stack_reg): New. (subst_stack_regs): When call_insn doesn't clobber any stack reg, don't clear the arguments. * rtl.c (shallow_copy_rtx): Don't clear flag used when orig is a insn. * shrink-wrap.c (requires_stack_frame_p): No need for stack frame for a fake call. * rtl.h (FAKE_CALL_P): New macro. --- gcc/rtl.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'gcc/rtl.h') diff --git a/gcc/rtl.h b/gcc/rtl.h index 35178b5..5ed0d6d 100644 --- a/gcc/rtl.h +++ b/gcc/rtl.h @@ -839,6 +839,11 @@ struct GTY(()) rtvec_def { /* Predicate yielding nonzero iff X is a call insn. */ #define CALL_P(X) (GET_CODE (X) == CALL_INSN) +/* 1 if RTX is a call_insn for a fake call. + CALL_INSN use "used" flag to indicate it's a fake call. */ +#define FAKE_CALL_P(RTX) \ + (RTL_FLAG_CHECK1 ("FAKE_CALL_P", (RTX), CALL_INSN)->used) + /* Predicate yielding nonzero iff X is an insn that cannot jump. */ #define NONJUMP_INSN_P(X) (GET_CODE (X) == INSN) -- cgit v1.1