From patchwork Mon Mar 27 12:23:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 75386 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1469577vqo; Mon, 27 Mar 2023 05:24:40 -0700 (PDT) X-Google-Smtp-Source: AKy350bYmcdUKCr6K9gl+aaVEle0uA9At0nFd4nYPndxihS5wyUsQaGj3WG4S+iTzgns6gz3ORqm X-Received: by 2002:aa7:cc04:0:b0:4fd:2a29:ceac with SMTP id q4-20020aa7cc04000000b004fd2a29ceacmr11277599edt.14.1679919879952; Mon, 27 Mar 2023 05:24:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679919879; cv=none; d=google.com; s=arc-20160816; b=z70CpwoTEOluVBVRHr/KaEQJh8SR7t4TTPYU+oHaXTfLWn+olyzmS0UtNdP2o4AIR1 YG23jO5XKMQZ2c2HtCciVS04zIVKEbzvI2+cF7gy6MP/cU/Z3J3Kd8XsRhWeXZlCGB/p 1nACFMTxS0qDbdyogqJ/KIqb+q5i17MVstUq3toNJJ/AOAk8JwqtWl53nAYe6reskx6y 3u/R7J+K/TOgWVLAQxkBGQVVGAcpiqigQ9LRnTG9MtE5AnoTGgjYbvofvwpGrOW8mk8F YwEsMrbe1IMDmVEgKo+uATSnnpYAFTFqOawXH2yYPJShvVU4Dqo9V/Ck/YWikkdXMcKw Gd+A== 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:message-id :mime-version:subject:to:date:dmarc-filter:delivered-to :dkim-signature:dkim-filter; bh=jLVBPoBg6epe9psoyc7duZSBLGcHoTiToULR/TQOI/o=; b=MfWiewOZz7bT8VGjTVOM8K2zW3Y4hmdAhnE53cv8dJDlrmggagwiyQbmNFhdNycFxG AuTL3zFbnPWqNxhU934G88aPTUhhpFP5ld1zQptLnm2PEopUaaAiPKm1R+IR/VZDb6X+ 6ah5wQmcbz9S0Jt4gcySxVUJdsbaqa1f4tj0pTPneK9zuvN94lEuV2Q/y1X8ziRiUJd+ wjY7W+wLLCYZYjEqapI217jLCVcKPRMMQs2+hyn+PW1KWDzY/sidCyJbbehn9MM2EuHi Vupj5IO49XWgDYGgkTPi2pXMMdVBjLQYf9lz6Oo9S2mztXEY9LI8vK3WSmUrONj9OtlT 4WpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=Ywj2CAni; 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 v14-20020aa7d64e000000b005021f0d5766si9011410edr.685.2023.03.27.05.24.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Mar 2023 05:24:39 -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=Ywj2CAni; 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 6FF8B3858025 for ; Mon, 27 Mar 2023 12:24:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6FF8B3858025 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1679919874; bh=jLVBPoBg6epe9psoyc7duZSBLGcHoTiToULR/TQOI/o=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=Ywj2CAniHA5NlKjVQGuqyrkMpe0s34vtyNbbCwiXJgY97SI8RxPpiXQhSKbFp5uCF 36SMkyNncYXLW8SCsLa/uILObh0878SYBgSMTj8LTZWhzfqXPtpRwkmODe4wkcGqU7 JF180MAUzwyETEkkAPIkY6Ja3+q+6B6asExgIovU= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id 39C3D3858D39 for ; Mon, 27 Mar 2023 12:23:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 39C3D3858D39 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 60B5822051 for ; Mon, 27 Mar 2023 12:23:49 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 4136E13482 for ; Mon, 27 Mar 2023 12:23:49 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id I2arDtWKIWRPSgAAMHmgww (envelope-from ) for ; Mon, 27 Mar 2023 12:23:49 +0000 Date: Mon, 27 Mar 2023 14:23:48 +0200 (CEST) To: gcc-patches@gcc.gnu.org Subject: [PATCH] tree-optimization/108357 - add testcase MIME-Version: 1.0 Message-Id: <20230327122349.4136E13482@imap2.suse-dmz.suse.de> X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, 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: Richard Biener via Gcc-patches From: Richard Biener Reply-To: Richard Biener 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?1761523668277415077?= X-GMAIL-MSGID: =?utf-8?q?1761523668277415077?= The following adds the testcase for the bug which was recently fixed. Pushed. PR tree-optimization/108357 * gcc.dg/tree-ssa/pr108357.c: New testcase. --- gcc/testsuite/gcc.dg/tree-ssa/pr108357.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/pr108357.c diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr108357.c b/gcc/testsuite/gcc.dg/tree-ssa/pr108357.c new file mode 100644 index 00000000000..44c457b7a97 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr108357.c @@ -0,0 +1,22 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-tree-threadfull1" } */ + +static char b; +static unsigned c; +void foo(); +short(a)(short d, short e) { return d * e; } +static short f(short d) { + b = 0; + if ((d && 0 >= c < d) ^ d) + ; + else + foo(); + return d; +} +int main() +{ + short g = a(5, b ^ 9854); + f(g); +} + +/* { dg-final { scan-tree-dump-not "foo" "threadfull1" } } */