From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-vs1-xe31.google.com (mail-vs1-xe31.google.com [IPv6:2607:f8b0:4864:20::e31]) by sourceware.org (Postfix) with ESMTPS id 1EB0D384783A for ; Wed, 7 Jul 2021 15:52:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 1EB0D384783A Received: by mail-vs1-xe31.google.com with SMTP id h126so1837465vsc.6 for ; Wed, 07 Jul 2021 08:52:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Nx4MjL7HLmpnpKduTjkRRRJ909x22p4f0RcbaVi6Tgg=; b=MadNUs2PghkYnH83BTQ020uQX+iuDcqgUpzPLO803DjgmM4+7kfAI8QCe7R94VqmLg vI+GWtJ9+P0cfwzbGmsfOv8nv13npc/vpHzvNC0jKAhmSAoI84I6x9mc3M8vIB2621GX AZNy7ilvcUemPDTxeFcT+roqFDBQi1wAuXPcuk3pT3NcNnUDFp7yzFTN9+Zkq2vT8YBM XWvD77GyKRuVWNA8Vqb6SvZ/UBQli3mrFB9XdFqoP5M47z2X1W4vTnYfs+wfH2KRpZXr TPJVcFmyjcTKdGkyvOszAk47JGT/EHHUq37qtvgvQE+X8dqILmzfoo+0dDrdEkYslKSu qZfg== X-Gm-Message-State: AOAM5321oLPUXkzzbr5FKGDEfh3i4Uy4T7UnDeZoNtMWeFrlKrCs92kd +zOIc2qqXAh0lPLzRdncsRXoz+a/VQgDLJlifSg= X-Google-Smtp-Source: ABdhPJwnRk86VzJc1bEGcjpjd+NXjziCmOKY/r2fZ84GYlibsOj9kP0UkGq6KjZ5d+SKxb8Qok2HZAL97VKg4BkWUOQ= X-Received: by 2002:a05:6102:90c:: with SMTP id x12mr21741269vsh.5.1625673142689; Wed, 07 Jul 2021 08:52:22 -0700 (PDT) MIME-Version: 1.0 References: <20210603065408.47912-1-hongtao.liu@intel.com> <20210705233008.GJ1583@gate.crashing.org> In-Reply-To: From: Hongtao Liu Date: Wed, 7 Jul 2021 23:52:11 +0800 Message-ID: Subject: Re: [PATCH 1/2] CALL_INSN may not be a real function call. To: Richard Biener Cc: Segher Boessenkool , Jakub Jelinek , Richard Sandiford , liuhongt , GCC Patches Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Jul 2021 15:52:24 -0000 On Wed, Jul 7, 2021 at 4:15 PM Richard Biener wrote: > > On Wed, Jul 7, 2021 at 4:40 AM Hongtao Liu via Gcc-patches > wrote: > > > > On Tue, Jul 6, 2021 at 9:37 AM Hongtao Liu wrote: > > > > > > On Tue, Jul 6, 2021 at 7:31 AM Segher Boessenkool > > > 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