From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x102f.google.com (mail-pj1-x102f.google.com [IPv6:2607:f8b0:4864:20::102f]) by sourceware.org (Postfix) with ESMTPS id 34D473858408 for ; Mon, 26 Jul 2021 15:07:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 34D473858408 Received: by mail-pj1-x102f.google.com with SMTP id o44-20020a17090a0a2fb0290176ca3e5a2fso422541pjo.1 for ; Mon, 26 Jul 2021 08:07:04 -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=DrNAVsEoc1Jmf2UL5eEiHvMC5cdMpLak50u3/m4QdEU=; b=SoMiHcDx5Z3XF1epvV7THApiMWmv5QdsP5fV4c17zqVJZjMQnN4y/lOiZM6ta27sEQ zNMHmdDvCxVvYGfICEb/uDpct0bfT2801w+gMmJsbVvcoxwrvjnFkQcxZ7MFj/IdKJQV BtSYZMHjkWF+3uG/9sw6/zi48+dZYJB8CrbaDmyOGi1H/aW58Cbxjtg2E9z99P6FbNsH OZeUqK1YhQ692gJ5kUi4YD+eLVS5zTBX+kilGR4+jMA/NERsAlWVMznCRbI/iHBtDbzv mDg8GgQ+RMJp9Gu1cXRdiQzogyM+UwUgnSJnbnX8MJl67jYrdeRNNDkYDjyMqoJb+sFW SM7g== X-Gm-Message-State: AOAM530/7hfrpTDi3N5y94Vgpe5Y9nqw8F9ShaBuQNoj/hajHNhXmhu3 X1hawt9SMjQWRBBCSgOX3bAJnu9unF4= X-Google-Smtp-Source: ABdhPJyPQnJHB2ikHBLfU8GSc6gcH1vycVoZP2aHkvA6KEoxAXRhjqnFuXS7WOcsyd5mSXufyADwig== X-Received: by 2002:a17:903:2307:b029:12b:9349:22d7 with SMTP id d7-20020a1709032307b029012b934922d7mr14776190plh.9.1627312022911; Mon, 26 Jul 2021 08:07:02 -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 d67sm308664pfd.81.2021.07.26.08.07.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 26 Jul 2021 08:07:02 -0700 (PDT) Subject: Re: 0001-Don-t-skip-prologue-instructions-as-it-could-affect-.patch To: "Bin.Cheng" Cc: "bin.cheng" , GCC Patches References: From: Jeff Law Message-ID: <54c74204-38f5-690a-6f0c-6b9fb5e96756@gmail.com> Date: Mon, 26 Jul 2021 09:07:01 -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.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, 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: Mon, 26 Jul 2021 15:07:06 -0000 On 7/25/2021 7:47 PM, Bin.Cheng wrote: > On Sat, Jul 24, 2021 at 12:30 AM Jeff Law via Gcc-patches > wrote: >> >> >> On 7/14/2021 3:14 AM, bin.cheng via Gcc-patches wrote: >>> Hi, >>> I ran into a wrong code bug in code with deep template instantiation when working on sdx::simd. >>> The root cause as described in commit summary is we skip prologue insns in init_alias_analysis. >>> This simple patch fixes the issue, however, it's hard to reduce a case because of heavy use of >>> templates. >>> Bootstrap and test on x86_64, is it OK? >> It's a clear correctness improvement, but what's unclear to me is why >> we'd want to skip them in the epilogue either. > I can only guess, there is nothing to initialize epilogue for because > no code follows. Yea, but couldn't the lack of analysis of the epilogue lead to a pass mis-optimizing code within the epilogue itself?  It's not terribly likely, but it just seems wrong to skip the epilogue like this.  Remember, the aliasing bits are just an analysis phase to find the aliasing relationships that exist and we don't necessarily know how that data is going to be used.  It may in fact be safe now, but may not be safe in the future if someone added a late RTL pass that used the aliasing info in a new way. The more I think about it, the more I think we should remove remove this hunk of code completely.  There is some chance for fallout, but I think it's unlikely. Jeff