From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x1031.google.com (mail-pj1-x1031.google.com [IPv6:2607:f8b0:4864:20::1031]) by sourceware.org (Postfix) with ESMTPS id 29AB73857016 for ; Thu, 16 Sep 2021 15:22:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 29AB73857016 Received: by mail-pj1-x1031.google.com with SMTP id u13-20020a17090abb0db0290177e1d9b3f7so7797592pjr.1 for ; Thu, 16 Sep 2021 08:22:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=VOPcHA6K/8Y1K8cru2upHUactj7Nuu7QfmXrYD2NmLo=; b=o4uinv6yivsBUH0MarUS4WrEZfzFqvcv76FLDSvr5aubRMgxRhls2sErqhFjETz5at 80nK/0oJRSpCEH40tE2V/uXohuIz6tzT5je2/qEDXEDAGUFbVeW6cRLCGaF6jBBUcBAV xSsLQVBaMHqw5icvlWwlfDrpQI7mU/1H8MNqTCoIXubmdoEZGWtrCf6qf9XBJTKEk1jA i6Am5MUgN2wXwFVow3F1/nuM7hZFpOo12ueL/9G5TZcFLP8kz8nF0SzYGraOiV3h/TWF BnLeYyiyEIXO9pRXN+dZTlV/QDH2FNHrnoGDJFIXhBV+Pu5SV7quTRyndd/5h8j8ilJQ Ck+w== X-Gm-Message-State: AOAM533Wn339oBAYvuTqLB15IVkb/4sGCsPkdvC7Oga46vSLGG5vArOB hwhkzsyfkH7YopvuRquujc4P4tF1XcQ= X-Google-Smtp-Source: ABdhPJwbxBMYZL2rBrTzOW0/t5JiMwZ8TTbwl3P7XF5u89p3Azy22wSXOcTxj5o/La+crcn5HdecSw== X-Received: by 2002:a17:902:780f:b0:13a:3919:e365 with SMTP id p15-20020a170902780f00b0013a3919e365mr5333384pll.63.1631805761917; Thu, 16 Sep 2021 08:22:41 -0700 (PDT) Received: from [172.31.0.175] (c-98-202-48-222.hsd1.ut.comcast.net. [98.202.48.222]) by smtp.gmail.com with ESMTPSA id v13sm3582232pfm.16.2021.09.16.08.22.41 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 16 Sep 2021 08:22:41 -0700 (PDT) Subject: Re: [patch] Fix PR rtl-optimization/102306 To: Eric Botcazou , gcc-patches@gcc.gnu.org References: <3130475.aeNJFYEL58@fomalhaut> From: Jeff Law Message-ID: <91219e12-1edf-31b2-c9a9-61f8b7810d56@gmail.com> Date: Thu, 16 Sep 2021 09:22:40 -0600 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: <3130475.aeNJFYEL58@fomalhaut> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, KAM_NUMSUBJECT, 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: Thu, 16 Sep 2021 15:22:44 -0000 On 9/16/2021 3:02 AM, Eric Botcazou wrote: > Hi, > > this is a duplication of volatile loads introduced during GCC 9 development by > the new 2->2 mechanism of the RTL combiner. There is already a substantial > checking for volatile references in can_combine_p but it implicitly assumes > that the combination reduces the number of instructions, which is of course > not the case here. So the fix teaches try_combine to abort the combination > when it is about to make a copy of volatile references to preserve them. > > Bootstrapped/regtested on x86-64/Linux, OK for mainline and release branches? > > > 2021-09-16 Eric Botcazou > > PR rtl-optimization/102306 > * combine.c (try_combine): Abort the combination if we are about > to duplicate volatile references. > > > 2021-09-16 Eric Botcazou > > * gcc.target/sparc/20210916-1.c: New test. OK jeff