From patchwork Thu Nov 25 14:03:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrew MacLeod X-Patchwork-Id: 1559726 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=fl1rHdDv; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4J0KP63WDQz9sVc for ; Fri, 26 Nov 2021 01:04:10 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 558503858422 for ; Thu, 25 Nov 2021 14:04:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 558503858422 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1637849048; bh=HOCsSygid6tqmreWJS9wXAu7IogsGxyNh7TAh727f90=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=fl1rHdDvyHQW5+ZaaPjqrUT2oUkH1gLF4dTLg4KONWD4T5Bl4Imrz8kaYBX4isQba VZagn4tQgFrc8CcAQEXyWjXDZVGU/QdrBQjXRI6krTw5vhT6LQ64WE5yCnYkMAQ5bF OdO2xTYTblrYTrPqllA7etiiQ+tEev+Gr0aOK4i8= 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.133.124]) by sourceware.org (Postfix) with ESMTPS id 1C620385842C for ; Thu, 25 Nov 2021 14:03:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 1C620385842C Received: from mail-qv1-f69.google.com (mail-qv1-f69.google.com [209.85.219.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-456-7dcOoQ-XMOqTpqQyfQO55g-1; Thu, 25 Nov 2021 09:03:18 -0500 X-MC-Unique: 7dcOoQ-XMOqTpqQyfQO55g-1 Received: by mail-qv1-f69.google.com with SMTP id jt9-20020a05621427e900b003c027cd9516so6768375qvb.20 for ; Thu, 25 Nov 2021 06:03:18 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent :content-language:to:from:subject; bh=ZbkSHHWmz0KG9DCBKhSvEKrLYLDT7hn4NmqdcX2sN88=; b=Ow/ZA00CsYmKaIA/ejvdJnxAYAHEmKaAui8Mv7rgGc2IB9F29k1S4SUnkWwq4oxE/G l0xOyuzmNp2YiDRPNn6J+7KGhPl0ufs6V6cpwB7RWKv8+yI17Bf1ZsqSuaQybXETEksR NiX5c06JWoi6HwGxqcgA5CRI2+/GCgVeYIJwpOIkHI4fcJXramNZXPkkp+5e/RPTMViG Jb/6YNFN7a9SSbwza4shOYcta1OjBBEi2n7mrTIB7Nx+7ePovnXDV6des3p4TashUhyW tBNAWN2PE2vb+7Pfuw8AYkw7yyYQbT7IXnPeU2+TV/8JAExNjGi8gtRqQyoMlpTrxQNq tZiw== X-Gm-Message-State: AOAM530DVrtR8EsDOJKfhEfhEawSOvnmEsQ3m7M18DC9Enj0rFvT7Iwf yf0/NaCh0js4QWmFdTwIUHDhqIUPuAxp5aA1zaeb+Ler9kutuHINXHOkjSmnwbKOafMh0RrXHMx UCAbVla5E+kDIFCPYP/xMQVgMJhWDXp5bOiJF0+ZEjAFszfvLI2bU4kgN0UN7nO+vi0CZ+A== X-Received: by 2002:a37:68ce:: with SMTP id d197mr7506682qkc.693.1637848997557; Thu, 25 Nov 2021 06:03:17 -0800 (PST) X-Google-Smtp-Source: ABdhPJx3jQXjwLNn5EJl1MVKx7vKa4XSs6nUTitv7WQ+UphT7QgUnOexkR9meOPKzJHfpuRT4pl0cg== X-Received: by 2002:a37:68ce:: with SMTP id d197mr7506635qkc.693.1637848997131; Thu, 25 Nov 2021 06:03:17 -0800 (PST) Received: from ?IPV6:2607:fea8:a262:5f00::38cf? ([2607:fea8:a262:5f00::38cf]) by smtp.gmail.com with ESMTPSA id n19sm1625974qta.78.2021.11.25.06.03.16 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 25 Nov 2021 06:03:16 -0800 (PST) Message-ID: <003b078a-77c9-e8db-438d-2c48f178579b@redhat.com> Date: Thu, 25 Nov 2021 09:03:15 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.3.2 To: gcc-patches Subject: [COMMITTED] PR tree-optimization/102648 - Add the testcase for this PR to the testsuite. X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-CA X-Spam-Status: No, score=-12.7 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: Andrew MacLeod via Gcc-patches From: Andrew MacLeod Reply-To: Andrew MacLeod Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" Various ranger enabled passes, such as threading, or VRP2 resolve this now.  I'm adding the test case before closing. committed as obvious. Andrew commit 1598bd47b2a4a5f12b5a987d16d82634644db4b6 Author: Andrew MacLeod Date: Thu Nov 25 08:58:19 2021 -0500 Add the testcase for this PR to the testsuite. Various ranger-enabled patches like threading and VRP2 can do this now, so add the testcase for posterity. gcc/testsuite/ PR tree-optimization/102648 * gcc.dg/pr102648.c: New. diff --git a/gcc/testsuite/gcc.dg/pr102648.c b/gcc/testsuite/gcc.dg/pr102648.c new file mode 100644 index 00000000000..a0f6386dde3 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr102648.c @@ -0,0 +1,21 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -fdump-tree-optimized" } */ + +void foo(); +static char a, c; +static int d, e; +static short b(short f, short g) { return f * g; } +int main() { + short h = 4; + for (; d;) + if (h) + if(e) { + if (!b(a & 1 | h, 3)) + c = 0; + h = 1; + } + if (c) + foo(); +} + +/* { dg-final { scan-tree-dump-not "foo" "optimized" } } */