From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com [IPv6:2607:f8b0:4864:20::630]) by sourceware.org (Postfix) with ESMTPS id D9B87394800A for ; Fri, 28 Jan 2022 17:35:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D9B87394800A Received: by mail-pl1-x630.google.com with SMTP id u11so6636549plh.13 for ; Fri, 28 Jan 2022 09:35:07 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=USi2mNqci6y+wPtHV3AV/LMcNYPOF96qCFtdTrEDVKQ=; b=azezxP+UlvJl8tkOFMdSxsi3SNEyXM7KPvYTw8OrhLysw5CyrNEp8DQO2zUQzPH1hO kXB5BDL1OKw6UDPNac+Oi/2Q0nsobBMezSjQY0AKVbkRSQhcLMaqMVYXw+n0Il7mNW82 rwW6YoTzPcwBgxaouHbeM4Vwx9/s/hYXWMcrYansZfPNFavmSqf9DlCVX7Ah7D4PiFGZ IlLZrWwNTD6Zf/HsWZUgQ1HcujlJgN6uQh4WMoLqgP8YcjSm43AFs0wYcbgYl1uwSELs 1XirDXOi+ro9GCJ+JbzqtDxFz6ljGMeqZMMP45+9lURc+8hLLpoi9ExkK0QscxV0YgGu a9hA== X-Gm-Message-State: AOAM533CjQhW+KSM3q46i3Zv3OTay0qfDiymvqSCI8fpbV6KuoActspd 9nkxFUBiDg8XulKBLqy3Rzs= X-Google-Smtp-Source: ABdhPJzn+mCcyOSAFPAeqAISDHhXZaRxaQHMO+rHXIFoqNw/KeSjCXWFz9JAlG6jxNvcjkWHueq2Yg== X-Received: by 2002:a17:902:6943:: with SMTP id k3mr8964830plt.127.1643391306910; Fri, 28 Jan 2022 09:35:06 -0800 (PST) Received: from [192.168.1.15] (65-130-85-11.slkc.qwest.net. [65.130.85.11]) by smtp.gmail.com with ESMTPSA id f3sm10540861pfe.67.2022.01.28.09.35.05 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 28 Jan 2022 09:35:06 -0800 (PST) Message-ID: Date: Fri, 28 Jan 2022 10:35:03 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [PATCH] store-merging: Fix up a -fcompare-debug bug in get_status_for_store_merging [PR104263] Content-Language: en-US To: Jakub Jelinek , Richard Biener Cc: gcc-patches@gcc.gnu.org References: <20220128163124.GQ2646553@tucnak> From: Jeff Law In-Reply-To: <20220128163124.GQ2646553@tucnak> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.9 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, SCC_BODY_URI_ONLY, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE 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, 28 Jan 2022 17:35:10 -0000 On 1/28/2022 9:31 AM, Jakub Jelinek via Gcc-patches wrote: > Hi! > > As mentioned in the PRthe following testcase fails, because the last > stmt of a bb with -g is a debug stmt and get_status_for_store_merging > uses gimple_seq_last_stmt (bb_seq (bb)) when testing if it is valid > for store merging. The debug stmt isn't valid, while a stmt at that > position with -g0 is valid and so the divergence. > > As we walk the whole bb already, this patch just remembers the last > non-debug stmt, so that we don't need to skip backwards debug stmts at the > end of the bb to find last real stmt. > > Bootstrapped/regtested on powerpc64le-linux, ok for trunk? > > 2022-01-28 Jakub Jelinek > > PR tree-optimization/104263 > * gimple-ssa-store-merging.cc (get_status_for_store_merging): For > cfun->can_throw_non_call_exceptions && cfun->eh test whether > last non-debug stmt in the bb is store_valid_for_store_merging_p > rather than last stmt. > > * gcc.dg/pr104263.c: New test. OK jeff