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: 1760716 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4PjfRh1pFgz1yXv for ; Fri, 24 Mar 2023 22:02:07 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E34B238708E2 for ; Fri, 24 Mar 2023 11:02:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E34B238708E2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1679655725; bh=l7uyxB3mJ4esYZyTL5fXu3mXTVZlHZWuWJQ9MMw2mVQ=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=u8Ti9waL021rV8d4NWtlvP70WMW92n5PQ9nuWC7aSDn9P6ZWXs+RA/JttJTAj2hM6 Vu9A0lB/vthEtSljwpeGMSisin5Z9Dh7B8ML+WXqcCrBxHrHQj2xf/8dtS8OgwOTOS AfZe/oyAqZ8mtCATbNWgIt1qii3ld0UH7F4Ipj2s= 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+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" 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 (); +}