From patchwork Sat Sep 7 17:58:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrew MacLeod X-Patchwork-Id: 1982162 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=QbTa4UOx; dkim-atps=neutral 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=server2.sourceware.org; envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.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 (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4X1LTP07vvz1y1H for ; Sun, 8 Sep 2024 03:59:37 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id CE700385C6CD for ; Sat, 7 Sep 2024 17:59:34 +0000 (GMT) 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 ESMTP id ECEF7385DDD2 for ; Sat, 7 Sep 2024 17:58:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org ECEF7385DDD2 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org ECEF7385DDD2 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1725731934; cv=none; b=at2bw6ycdDdr/lg7xK4/s/8StVakwFb5NAK+2QUEk5qih+nQLfYB81CaDijAn302+Q7p20dNhzGouSNIWeZzlvzt1Dc311cKHKzkbL80BOJz5q3VKSaQ1ifPi8mw2W3oR5EYEbZiBNA98rQLFuP4awRVJxTkdrVCms0/fc5L4Sw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1725731934; c=relaxed/simple; bh=eGQcBGMxWSMBjl6GCysI+f1j7jCT0Bc0LFHhZ5COeXk=; h=DKIM-Signature:Message-ID:Date:MIME-Version:To:From:Subject; b=ackLQYes4NWjHKzoh5a28rz+DWJIFubPmlHo/7Upy+eEAhLJcoiAzPL707kf37dJeWFsuHt6SPKlkIZRHTGp8vXrcoNW6X9rQEt1WTYzxIPPpd9MlUKsEKbKlg0LtOwvHrnnxgzGMM63xU0xsxsGcyQWLflxQvgmbd94OjeRtOo= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1725731931; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type; bh=RG3JgSCJseHkJBaoK8tYb0UAyKSaUs+Q5FeUTQrjPUQ=; b=QbTa4UOxQUK80p+Y49WO2cuXB7h8618Hrq8ai0OGjKBbHzGA80wg44tV9Qw5hj+EZV/zTu OIpjpp+NFAmg17krZRJ98V2iDfb27EljZtB17gYm9efQ5CFaibTGxvYEkonJPB0NvihbKb SicjA8KcK+UYnQHboU32ueRP3sE5TPk= 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.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-8-6P89BnnlMKKz90jg4Jks1g-1; Sat, 07 Sep 2024 13:58:49 -0400 X-MC-Unique: 6P89BnnlMKKz90jg4Jks1g-1 Received: by mail-qv1-f69.google.com with SMTP id 6a1803df08f44-6c3702d3ecfso47431406d6.0 for ; Sat, 07 Sep 2024 10:58:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725731928; x=1726336728; h=subject:from:cc:to:content-language:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=f9s0ueIWoZLp4RRYOa9pfVkwvDy9AWcUXZMN6vSvuyo=; b=P1Fh0ExbpjKyUMxahVU/3Wu1ezZBwYmHnGb7/Zge2C2ZKXNu6fVTStAPfUXJ4JQ1F1 x6ojiz/aO0CXewGdDarv7USJa4fC+nxS5QRUuoeZVk9A3Ksk/3I2YYjMcsc1iaCCUqeD jLQLrrZIS8XWzWocBN48Nvx7CbsGQbH9rVtT7qvuAD/bjfpLkY7lGOXJXsetl5tcJynM yaZbiJ8cZ9Za4awlNtHU702tHkwehazrY4kFBgKkGVGzFNQ/BLcAo5ZUEEWrsloEQVEE dbD3iH+rf8o9YSWhfAQmzrEwE3UXiGaBmBNvXviqPOx0MtEOoRQobR+pD2mRD/gI5Sah OeJg== X-Gm-Message-State: AOJu0Yyok2yawwWsxBtZDeiAsixNo8L4VBres4PFy2T9qZHFDAPGw79f w62RlbX4BSAMveW5bP5bGHLJTp3yPdHloRIAGjw/9em/20y3tWBL9NZsUntZSh4VEjM+fF2M3BA X0ZOUtZsUiZbfVpKuBeA/ztIm8zo2CDkxuRa7kkDPKiTFz4BUIIGkkpTDGqoFgCwYbUPq0OFuv1 YVRs3ag8Q4e1XRLAvw2jx8b7qgn7g1dGDfHnzMk8c= X-Received: by 2002:a05:6214:4888:b0:6c3:6e6f:794a with SMTP id 6a1803df08f44-6c5283fcaa9mr96752586d6.20.1725731928680; Sat, 07 Sep 2024 10:58:48 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG3GfEYwXRnzRSUG5cqxiV2F7oIdl+RiPrz/sAJqp6Dt28uK7njI5sv4isRraBsvoI8iAdj1Q== X-Received: by 2002:a05:6214:4888:b0:6c3:6e6f:794a with SMTP id 6a1803df08f44-6c5283fcaa9mr96752386d6.20.1725731928286; Sat, 07 Sep 2024 10:58:48 -0700 (PDT) Received: from ?IPV6:2607:fea8:51de:a700::361e? ([2607:fea8:51de:a700::361e]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6c534347344sm6101986d6.61.2024.09.07.10.58.46 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 07 Sep 2024 10:58:47 -0700 (PDT) Message-ID: <53b44a35-fdf6-47bd-ac06-ee1b584d6dd3@redhat.com> Date: Sat, 7 Sep 2024 13:58:46 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: gcc-patches Cc: "hernandez, aldy" From: Andrew MacLeod Subject: [PATCH] PR tree-optimization/116588 - Before running fast VRP, make sure all edges have, EXECUTABLE set. X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US X-Spam-Status: No, score=-12.6 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_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, 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.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org It appears when we run the fast VRP algorithm, I was neglecting to set all the edges to executable before starting, so a little garbage was sneaking in once in a while... Fixed by calling the same routine regular VRP calls to do this. Bootstraps on x86_64-pc-linux-gnu with no regressions.   Pushed. Andrew From 73356860e2e96cf3319de8f11eed74fd9ff80c65 Mon Sep 17 00:00:00 2001 From: Andrew MacLeod Date: Fri, 6 Sep 2024 11:42:14 -0400 Subject: [PATCH 5/5] Before running fast VRP, make sure all edges have EXECUTABLE set. PR tree-optimization/116588 gcc/ * tree-vrp.cc (execute_fast_vrp): Start with all edges executable. gcc/testsuite/ * gcc.dg/pr116588.c: New. --- gcc/testsuite/gcc.dg/pr116588.c | 31 +++++++++++++++++++++++++++++++ gcc/tree-vrp.cc | 1 + 2 files changed, 32 insertions(+) create mode 100644 gcc/testsuite/gcc.dg/pr116588.c diff --git a/gcc/testsuite/gcc.dg/pr116588.c b/gcc/testsuite/gcc.dg/pr116588.c new file mode 100644 index 00000000000..677964dd1d6 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr116588.c @@ -0,0 +1,31 @@ +/* PR tree-optimization/116588 */ +/* { dg-do run { target bitint575 } } */ +/* { dg-options "-O2 -fno-vect-cost-model -fno-tree-dominator-opts -fno-tree-fre --param=vrp-block-limit=0 -DDEBUG -fdump-tree-vrp2-details" } */ + +int a; +__int128 b, c; + +__int128 +foo (_BitInt (129) e) +{ + _BitInt (129) f = e << (128 - c); + __builtin_memset (&b, a, 4); + __int128 r = e + f; + return r; +} + +int +main () +{ + __int128 x = foo (0); +#ifdef DEBUG + for (unsigned i = 0; i < sizeof (x); i++) + __builtin_printf ("%02x", i[(volatile unsigned char *) &x]); + __builtin_printf("\n"); +#else + if (x) + __builtin_abort(); +#endif +} + +/* { dg-final { scan-tree-dump-not "0 != 0" "vrp2" } } */ diff --git a/gcc/tree-vrp.cc b/gcc/tree-vrp.cc index e184e9af51e..975e71f7725 100644 --- a/gcc/tree-vrp.cc +++ b/gcc/tree-vrp.cc @@ -1258,6 +1258,7 @@ execute_fast_vrp (struct function *fun, bool final_p) fvrp_folder folder (&dr, final_p); gcc_checking_assert (!fun->x_range_query); + set_all_edges_as_executable (fun); fun->x_range_query = &dr; // Create a relation oracle without transitives. get_range_query (fun)->create_relation_oracle (false); -- 2.45.0