From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x62c.google.com (mail-pl1-x62c.google.com [IPv6:2607:f8b0:4864:20::62c]) by sourceware.org (Postfix) with ESMTPS id 650093850432 for ; Fri, 23 Jul 2021 16:27:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 650093850432 Received: by mail-pl1-x62c.google.com with SMTP id e10so3862142pls.2 for ; Fri, 23 Jul 2021 09:27:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=puuvDw5o10O1miz8G7udRAyQZLe4wwDgcCjS2XajPpU=; b=sFhLwX/EGBgtKeFDQp0QoDvhhmtt9giSSxhFWsLCgMlfhw5xYGuF7LgDbofb4jGp/L GDw4XcU78y1MBJksi0Cc8I3/uVPlzhFo8CWKn76zRmmRphx+ghQt7rmyNkLm3BzkKe9/ blpqEoMRNqkwsbTXpVZRU+DbdWl8tTU/TlBWhvTqE8of//TiO87PJCbsbbDGYiLkZwr5 FGM+TEBq/2Xt6CoUAeA+WkRJ61AuWfPFf14/oRiNHuiKaPvxP89ONnL2CM9xq7RaPwV4 fBsg+iv5v3ujmgo86o5LgKLIoaQIKW9kqtyveEgptiFe+16jsVx0eDP5cvscvo00+WZY gNsA== X-Gm-Message-State: AOAM5301g8ml0Qt0DkNMXyQVlxS8oQFdhBykKl9J4+3qFTlkCG2XjkEr C6Y4j/iOpvzRN7GStnHymBM= X-Google-Smtp-Source: ABdhPJwlGlw4k5Au/UBpDzhlewPBzS4uCtwj/EoqBH60NoE9ZbTg1hnfhFEeD0VxXdu6piCC3u0HWA== X-Received: by 2002:a17:903:49:b029:12b:1c88:101b with SMTP id l9-20020a1709030049b029012b1c88101bmr4454153pla.30.1627057662324; Fri, 23 Jul 2021 09:27:42 -0700 (PDT) Received: from [192.168.1.17] (c-98-202-48-222.hsd1.ut.comcast.net. [98.202.48.222]) by smtp.gmail.com with ESMTPSA id s7sm33107841pfk.12.2021.07.23.09.27.39 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 23 Jul 2021 09:27:42 -0700 (PDT) Subject: Re: 0001-Don-t-skip-prologue-instructions-as-it-could-affect-.patch To: Richard Biener , "Bin.Cheng" , Eric Botcazou , Jeff Law , Segher Boessenkool Cc: GCC Patches , "bin.cheng" References: From: Jeff Law Message-ID: Date: Fri, 23 Jul 2021 10:27:37 -0600 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, KAM_SHORT, NICE_REPLY_A, 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: Fri, 23 Jul 2021 16:27:45 -0000 On 7/22/2021 7:04 AM, Richard Biener via Gcc-patches wrote: > On Thu, Jul 22, 2021 at 9:02 AM Bin.Cheng via Gcc-patches > wrote: >> Gentle ping. Any suggestions would be appreciated. > So just to say something - does the existing code mean that any use of > the alias info on prologue/epilogue insns is wrong? We have > > /* The prologue/epilogue insns are not threaded onto the > insn chain until after reload has completed. Thus, > there is no sense wasting time checking if INSN is in > the prologue/epilogue until after reload has completed. */ > bool could_be_prologue_epilogue = ((targetm.have_prologue () > || targetm.have_epilogue ()) > && reload_completed); > > so when !could_be_prologue_epilogue then passes shouldn't run into > them if the comment is correct. But else even epilogue stmts could appear > anywhere (like scheduled around)? So why's skipping those OK? These insns don't exist until after reload has completed.  I think this code is just trying to be more compile-time efficient and not look for them when they're known to not exist. As for why they're skipped?  That seems wrong to me.  That was added by Kenner: https://gcc.gnu.org/pipermail/gcc-patches/2000-May/031560.html Interestingly enough myself (and others) preserved that behavior through several updates to this code. > > Are passes supposed to check whether they are dealing with pro/epilogue > insns and not touch them? CCing people that might know. Generally most passes can treat them as any other RTL. Jeff