From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x635.google.com (mail-pl1-x635.google.com [IPv6:2607:f8b0:4864:20::635]) by sourceware.org (Postfix) with ESMTPS id 03B183858401 for ; Tue, 28 Dec 2021 15:21:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 03B183858401 Received: by mail-pl1-x635.google.com with SMTP id w7so13264092plp.13 for ; Tue, 28 Dec 2021 07:21:58 -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=lAbiUIZa7jhHpGzz/KCVlXPgQ6gIMta52FOw5Q4Hiqo=; b=mdwaviYEZXWx8qGaUAoIQlHXPUtl7KPRT34cD3b9jvl32lSwc19+WqQbPfDPIhzrzD AZF8OEtqF5SqlzuepLpOJF2bLfaswxihcfxJp0WhdeDOnB9+M7a8cn7Mdfz61yunnwIa 0Tux2BXuVaFDXYHvCDwc/Uq9ZN28Ax9nQDHeFjQpQt/lRr0PnUsmJvCfyrJcwFdDedFm 9B4Tm7CKdwEAiS57fcdeY5gMBhq3dpcJ14o2WpwcHiEuwLtZJe9vc4cVaHtyMqfnYJ0c 4Ug/cGuZdcdxWDgkXO3cAZcfVcNsCBTaUrmxQWcBL5wFGArXmbve1tWgLYq0+R5c56zW Nf1Q== X-Gm-Message-State: AOAM530r10aVQA5Op06LTBUxnVVbhbZYflb7+sh501RZLgvs3cs3y1bp uVauQ5VTqmKep/KpEmaA1p4= X-Google-Smtp-Source: ABdhPJyo4kp7AzxEzTzfuyJMT6MWbJgxgPZ2Yq9JdFSm0rW+WHX9pwVkOZ38yuqn+zQO2R8O/ZbNTA== X-Received: by 2002:a17:90a:e2cf:: with SMTP id fr15mr26832724pjb.63.1640704918008; Tue, 28 Dec 2021 07:21:58 -0800 (PST) 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 t25sm9650984pgv.9.2021.12.28.07.21.57 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 28 Dec 2021 07:21:57 -0800 (PST) Message-ID: <513c5e28-9081-39ae-e66d-5eb61b06e929@gmail.com> Date: Tue, 28 Dec 2021 08:21:56 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.4.0 Subject: Re: [PATCH] fold-const: Fix up fold_truth_andor_1 shift handling [PR103813] Content-Language: en-US To: Jakub Jelinek , Richard Biener Cc: gcc-patches@gcc.gnu.org References: <20211228102723.GQ2646553@tucnak> From: Jeff Law In-Reply-To: <20211228102723.GQ2646553@tucnak> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.1 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: Tue, 28 Dec 2021 15:22:00 -0000 On 12/28/2021 3:27 AM, Jakub Jelinek wrote: > Hi! > > Some time ago I've changed const_binop -> wide_int_binop, so that it punts > on shifts by negative count. fold_truth_andor_1 doesn't check the results > of const_binop (?SHIFT_EXPR, ) though and assumes they will be always > non-NULL, which is no longer the case. > > Fixed thusly, bootstrapped/regtested on x86_64-linux and i686-linux, ok > for trunk? > > 2021-12-28 Jakub Jelinek > > PR middle-end/103813 > * fold-const.c (fold_truth_andor_1): Punt of const_binop LSHIFT_EXPR > or RSHIFT_EXPR returns NULL. Formatting fix. > > * gcc.c-torture/compile/pr103813.c: New test. OK jeff