From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1679655705; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type; bh=l7uyxB3mJ4esYZyTL5fXu3mXTVZlHZWuWJQ9MMw2mVQ=; b=iX2H7/3yvtNeJ9+l9m8tHEKr99xAQ+UNgUyCeEf1EaYdyJo02PfbcRbS5+SSo6DWq8k8WB EAKjsOvQoRca7ZeH82CEKI1ImV2wLaYQ+Gkjgf6dT/B1djSXdLxQ4lud7Vb7Fd3rI6sBLp 2wg4JhgG9O1KXxIROvkWZqnWrBUI+2k= 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 From: Jakub Jelinek To: gcc-patches@gcc.gnu.org Subject: [committed] testsuite: Add testcase for already fixed PR [PR99739] Message-ID: Reply-To: Jakub Jelinek 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-Type: text/plain; charset=us-ascii 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 List-Id: 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. --- 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 (); +} Jakub