From patchwork Fri Mar 24 08:52:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 74482 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp534110vqo; Fri, 24 Mar 2023 04:02:43 -0700 (PDT) X-Google-Smtp-Source: AKy350Z6sP1239hI9dk8MzJIcvoyaILLUC5pLe+cF992LkSYgsnv/rTTFHIRbnYSUmPcEGM02B4O X-Received: by 2002:a17:907:3f27:b0:870:b950:18d4 with SMTP id hq39-20020a1709073f2700b00870b95018d4mr2859867ejc.5.1679655763531; Fri, 24 Mar 2023 04:02:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679655763; cv=none; d=google.com; s=arc-20160816; b=LOcopOxs4Q4NxXQKPmdvYZKc7PLvPcchbbkjm5WZP0Q0+6/tvN5spIhwDBf3CKP3OJ r00TuFc4ru6JnyFTgEbD4WNaYrwN2hYBEqyxlcUro6lmndH6W8WbDNVf0nZcyU1jcYcE p4c5WloqOiiDa2WSbDVS9ItZZnqVl1ZeAzmakwhOfJfjldIHH5oQZFrOpGqr10LW/K1r tgTnryCH+4rau6jr7hX3JDlYt4Hlpybuha7HkhPr2Pe/A4bHQy0E2ESHQBLV/O7QZdi4 Ngv0PF6R5D4wvPM4pIIf+9CSkRMjpD1pm12hn3uyA6zQq8Eu1Spgf7K0SOah8GR6qLNT uyNQ== 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:mime-version:message-id:subject:to:date :dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=l7uyxB3mJ4esYZyTL5fXu3mXTVZlHZWuWJQ9MMw2mVQ=; b=e2jerquDdKE49utmrsDTeAcdqqc+eabcfruRMDijT/sx0WDMK49mHPzx2WAGuz8szc dTgCyPLl4i8gL/cqacKPibXEv8u3EMFQWuroO0rZJx1VYSMmDGej1P+Jyn7EJ1BYcPN6 a02jJOF+Ord3XODPIwjf1R6wne5L5ZvUskr46suhwnlwmLcDmNd8GJz1oBwdqgpBcqdA +/Hdw5zNibfvDfN5LUZpm3U1o+gq5F6IvyCYDNtcKpagFFYnWimZ6GHkWbr0zwJsSB6I 3vKYXw4M7KqQUo2wFGi6DMBbIQ4CfUKIdqQrMCl6ufM3tsLO23j7aG1NqygNBDaNLaqh TrtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=JbKx2Ue2; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 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. [8.43.85.97]) by mx.google.com with ESMTPS id dy27-20020a05640231fb00b004fe95a9e4f6si19550761edb.493.2023.03.24.04.02.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Mar 2023 04:02:43 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=JbKx2Ue2; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 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 151B43876882 for ; Fri, 24 Mar 2023 11:02:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 151B43876882 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1679655751; bh=l7uyxB3mJ4esYZyTL5fXu3mXTVZlHZWuWJQ9MMw2mVQ=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=JbKx2Ue281Ih+xdzwMvleSfZS5cF+OlOcw2on0CnVEPpufiNdG0vshV1tBmGsfOTv d8+9VubwEZankx3ASCVGSvnrw9HhoErY7uQa7CVlOnROfcdRpMvw/+ir44XMbY4IPS fb6ztWzWTWQWS+ujrsKWW0+karb9j14IDjMeTXTg= 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 E3E593858D28 for ; Fri, 24 Mar 2023 11:01:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E3E593858D28 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-398-x0c9VFJNOQGmeHMFwu9Wbw-1; Fri, 24 Mar 2023 04:53:25 -0400 X-MC-Unique: x0c9VFJNOQGmeHMFwu9Wbw-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 25401886066 for ; Fri, 24 Mar 2023 08:53:05 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.192.16]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 752A8492B0A for ; Fri, 24 Mar 2023 08:52:55 +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 32O8qa8E3026789 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT) for ; Fri, 24 Mar 2023 09:52:41 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 32O8qNkH3026787 for gcc-patches@gcc.gnu.org; Fri, 24 Mar 2023 09:52:23 +0100 Date: Fri, 24 Mar 2023 09:52:23 +0100 To: gcc-patches@gcc.gnu.org Subject: [committed] testsuite: Add testcase for already fixed PR [PR99739] Message-ID: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline X-Spam-Status: No, score=-3.3 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP 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?1761246722302017608?= X-GMAIL-MSGID: =?utf-8?q?1761246722302017608?= Hi! This PR was fixed by r13-1268-g8c99e307b20, I'm adding testcase to make sure we don't regress on it in the future. Bootstrapped/regtested on x86_64-linux and i686-linux, committed to trunk as obvious. 2023-03-24 Jakub Jelinek PR tree-optimization/99739 * gcc.dg/tree-ssa/pr99739.c: New test. Jakub --- gcc/testsuite/gcc.dg/tree-ssa/pr99739.c.jj 2023-03-23 19:08:39.528651948 +0100 +++ gcc/testsuite/gcc.dg/tree-ssa/pr99739.c 2023-03-23 19:08:31.158770968 +0100 @@ -0,0 +1,40 @@ +/* PR tree-optimization/99739 */ +/* { dg-do compile } */ +/* { dg-options "-O1 -fdump-tree-optimized" } */ +/* { dg-final { scan-tree-dump-not "__builtin_abort \\\(\\\);" "optimized" } } */ + +static inline int +foo (int i, int j, int k) +{ + int x = 1; + if (i && j && k) + x = 2; + if (i && j && k) + return x; + return -1; +} + +void +bar (int i, int j, int k) +{ + if (foo (i, j, k) == 1) + __builtin_abort (); +} + +static inline int +baz (int i, int j, int k) +{ + int x = 1; + if (i && j && k) + x = 2; + if (i && k && j) + return x; + return -1; +} + +void +qux (int i, int j, int k) +{ + if (baz (i, j, k) == 1) + __builtin_abort (); +}