From patchwork Tue May 9 10:21:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 91495 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2766470vqo; Tue, 9 May 2023 03:22:27 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5O9r+fwAYwZ5cEqB2xViG4iSZP9iqKWsO5dSV+2gEb3rj5ldF4qEq+/7d8gaIPXi6R4obH X-Received: by 2002:a17:907:6295:b0:959:99bb:8cc2 with SMTP id nd21-20020a170907629500b0095999bb8cc2mr12220485ejc.34.1683627747724; Tue, 09 May 2023 03:22:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683627747; cv=none; d=google.com; s=arc-20160816; b=jkzUS0qeCFKTqQbEc4avLhbhQKEi3tRzyoO8s1HK+a31ybKwq7xqYn2GqiQ4H8iHYw DOLXejuxnA3CqCo3Ax19FbX/X2+4ahHBdROhTbje2Rfy7P+MiKhPLROeu9vIf1S7+FUo aVHF5UgMIsvVIYEqW361Fjxivmj0Xpmxen8dCF6ym/yYv5Dw5a/N849MAzz+KNyjmH5V Yl5Ub0JW1Y91SkPmIQCQmVk303SYHey2ySOFGvRKNOY7Nhl9QrNz8jUGkRTrSmxJWwQE LRSMNY9We/0zWwBOkj15QNaKMOF2es5AkZnnYMucClHx010zG8SanW5QVt1VjrDiGNNT 2JrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-disposition:in-reply-to:mime-version:references:message-id :subject:cc:to:date:dmarc-filter:delivered-to:dkim-signature :dkim-filter; bh=c2VtytY4noWR09iaighA0gWu7SSTL9ik7bV0Ze3RazA=; b=VyGZqwfCmmq8jOd1R4BuRo4TKyRH9JxwuLFEdrPLQlgm5d7GbPHJxSm5n5Na9HIXcV eurKE3fOzGEgkJ9WnqpS5n0HSxOUS2ytefb5i9VfxY+T4anjJXSNjxr18BNs2p1Jw+2r GGmkAdShwYd9gDO9rp/N6lMIlLbLIy39FHLTCvc3OUlpBe5Ach+g/kDMPl5oeFhUOvMq ++Cy5R/yP1HjpPB9plQviwLe0CDkRlvQPAqXg/+yPk6HwwDjotZPYIBqAxCDPWpvqnRH bURLOe4UMfYcQ/MdTAgRi+BxV4iYZMzYq4x0ajGofArWsk41D6Y5fiRttYPcUyXV7qHt veSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=HYtvdha3; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id mh17-20020a170906eb9100b00965b5aa15dfsi720293ejb.162.2023.05.09.03.22.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 May 2023 03:22:27 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=HYtvdha3; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6138D3858C3A for ; Tue, 9 May 2023 10:22:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6138D3858C3A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1683627746; bh=c2VtytY4noWR09iaighA0gWu7SSTL9ik7bV0Ze3RazA=; h=Date:To:Cc:Subject:References:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=HYtvdha37GbJlxmyi8ODW7F1Y/jp5FNXC8TF5KJs7pHl0UwVTu7N7dzr6W8crz92y iWj3VCwYPc9M9+p2+BgZasgjCU7cHgBCBY4d8r7jjrOgLag3xtzlPSKgG0QAHuGXy0 H0J2Mu1RqfCN7NmaF9zgrmgxAyLyKzwmeeVtfTMQ= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 82F173858D37 for ; Tue, 9 May 2023 10:21:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 82F173858D37 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-211-S7KyfHj5Ph2MyA8bTsc3Tw-1; Tue, 09 May 2023 06:21:40 -0400 X-MC-Unique: S7KyfHj5Ph2MyA8bTsc3Tw-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8B5FB280604A; Tue, 9 May 2023 10:21:40 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.194.156]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4D0DB40C6E67; Tue, 9 May 2023 10:21:40 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.17.1/8.17.1) with ESMTPS id 349ALbIP1652928 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Tue, 9 May 2023 12:21:37 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 349ALaBK1652927; Tue, 9 May 2023 12:21:36 +0200 Date: Tue, 9 May 2023 12:21:36 +0200 To: Richard Biener Cc: gcc-patches@gcc.gnu.org Subject: [committed] testsuite: Add further testcase for already fixed PR [PR109778] Message-ID: References: MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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-Patchwork-Original-From: Jakub Jelinek via Gcc-patches From: Jakub Jelinek Reply-To: Jakub Jelinek Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765411649121818793?= X-GMAIL-MSGID: =?utf-8?q?1765411649121818793?= Hi! On Tue, May 09, 2023 at 08:55:56AM +0000, Richard Biener wrote: > OK. Thanks. I came up with a testcase which reproduces all the way to r10-7469. LTO to avoid early inlining it, so that ccp handles rotates and not shifts before they are turned into rotates. Tested on x86_64-linux -m32/-m64, both trunk and 10 branch, committed to trunk as obvious so far: 2023-05-09 Jakub Jelinek PR tree-optimization/109778 * gcc.dg/lto/pr109778_0.c: New test. * gcc.dg/lto/pr109778_1.c: New file. Jakub --- gcc/testsuite/gcc.dg/lto/pr109778_0.c.jj 2023-05-09 12:03:18.186428978 +0200 +++ gcc/testsuite/gcc.dg/lto/pr109778_0.c 2023-05-09 12:00:18.506004676 +0200 @@ -0,0 +1,22 @@ +/* PR tree-optimization/109778 */ +/* { dg-lto-do run } */ +/* { dg-lto-options { "-O2 -flto" } } */ +/* { dg-require-effective-target int32 } */ + +int bar (int); + +__attribute__((noipa)) int +foo (int x) +{ + x = bar (x); + x = (x << 16) | (int) ((unsigned) x >> 16); + return x & 0x10000000; +} + +int +main () +{ + if (foo (0) || foo (-1)) + __builtin_abort (); + return 0; +} --- gcc/testsuite/gcc.dg/lto/pr109778_1.c.jj 2023-05-09 12:03:21.504381415 +0200 +++ gcc/testsuite/gcc.dg/lto/pr109778_1.c 2023-05-09 12:00:07.062168719 +0200 @@ -0,0 +1,7 @@ +int +bar (int x) +{ + x &= 0x22222222; + x |= (int) 0xf1234567U; + return x; +}