[PATCH 1/2] CALL_INSN may not be a real function call.
Hongtao Liu
crazylht@gmail.com
Wed Jul 7 15:52:11 GMT 2021
On Wed, Jul 7, 2021 at 4:15 PM Richard Biener
<richard.guenther@gmail.com> wrote:
>
> On Wed, Jul 7, 2021 at 4:40 AM Hongtao Liu via Gcc-patches
> <gcc-patches@gcc.gnu.org> wrote:
> >
> > On Tue, Jul 6, 2021 at 9:37 AM Hongtao Liu <crazylht@gmail.com> wrote:
> > >
> > > On Tue, Jul 6, 2021 at 7:31 AM Segher Boessenkool
> > > <segher@kernel.crashing.org> wrote:
> > > >
> > > > Hi!
> > > >
> > > > I ran into this in shrink-wrap.c today.
> > > >
> > > > On Thu, Jun 03, 2021 at 02:54:07PM +0800, liuhongt via Gcc-patches wrote:
> > > > > 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.
> > > >
> > > > Could you document somewhere what a "fake call" *is*? Including what
> > > > that means to RTL, how this is expected to be used, etc.? In rtl.h is
> > > fake call is used for TARGET_INSN_CALLEE_ABI, i'll add comments for
> > > #define FAKE_CALL_P(RTX) in rtl.h
> >
> >
> > Here's the patch I'm going to check in.
> >
> > Document FAKE_CALL_P in comments.
> >
> > gcc/ChangeLog:
> >
> > * rtl.h (FAKE_CALL_P): Add comments for FAKE_CALL_P.
> >
> > diff --git a/gcc/rtl.h b/gcc/rtl.h
> > index 5ed0d6dd6fa..9afc60f08d8 100644
> > --- a/gcc/rtl.h
> > +++ b/gcc/rtl.h
> > @@ -840,7 +840,13 @@ struct GTY(()) rtvec_def {
> > #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. */
> > + CALL_INSN use "used" flag to indicate it's a fake call.
> > + Used by the x86 vzeroupper instruction,
> > + in order to solve the problem of partial clobber registers,
> > + vzeroupper is defined as a call_insn with a special callee_abi,
> > + but it is not a real call and therefore has no function stack
> > + of its own.
>
> I think that's a big vague - you could then say a sibling or tail call
> to a function
> that doesn't set up a stack frame is fake as well? Maybe
>
> "CALL_INSN use "used" flag to indicate the instruction
> does not transfer control."
>
> thus that this call is not affecting regular control flow? (it might
> eventually still trap and thus cause non-call EH?)
>
> Not sure if "no function stack of its own" is a good constraint,
> vzeroupper does not perform any call or jump.
>
How about this?
/* 1 if RTX is a call_insn for a fake call.
- CALL_INSN use "used" flag to indicate it's a fake call. */
+ CALL_INSN use "used" flag to indicate it's a fake call.
+ FIXME: it's only used by x86 vzeroupper to indicate it's
+ a normal instruction which doesn't have function stack
+ and doesn't impact control flow, and FAKE_CALL_P is not
+ handled thoroughly in the RTL, PR82735. */
> > + NB: FAKE_CALL_P is not handled thoroughly in the RTL. */
> > #define FAKE_CALL_P(RTX) \
> > (RTL_FLAG_CHECK1 ("FAKE_CALL_P", (RTX), CALL_INSN)->used)
> >
> >
> >
> >
> > --
> > BR,
> > Hongtao
--
BR,
Hongtao
More information about the Gcc-patches
mailing list