From patchwork Thu Oct 28 14:50:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrew MacLeod X-Patchwork-Id: 1547548 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=gHVGdrTV; dkim-atps=neutral Authentication-Results: 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 RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4Hg7mb2qXnz9s1l for ; Fri, 29 Oct 2021 01:51:26 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 60AED3857802 for ; Thu, 28 Oct 2021 14:51:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 60AED3857802 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1635432684; bh=Fs31tWKRyYACbWQMYrdB45qc34qHu0lYAnae9ATEzxU=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=gHVGdrTVW0Bj7EZpB0SODICVW9cPROf84oI+OQnnK+wBfbZxdkQqEh1OfGx17Vn61 bTlZx8nZzcvmpaEFkdoS+93eGu5i8bUrW0f0gKpx+LHUS5mwgKmOerGiD+WhvOOMBb q0LcqXyn3TWRY9cN3pYBITgFYAszMCSyKKpM2u+w= 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 [216.205.24.124]) by sourceware.org (Postfix) with ESMTPS id 7EDDA3857811 for ; Thu, 28 Oct 2021 14:50:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7EDDA3857811 Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-597-YeESLQJwNQWaduSJQVMx8A-1; Thu, 28 Oct 2021 10:50:41 -0400 X-MC-Unique: YeESLQJwNQWaduSJQVMx8A-1 Received: by mail-qk1-f198.google.com with SMTP id bl10-20020a05620a1a8a00b004624f465b6eso4000662qkb.22 for ; Thu, 28 Oct 2021 07:50:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:to:cc:from:subject:message-id:date:user-agent :mime-version:content-language; bh=Fs31tWKRyYACbWQMYrdB45qc34qHu0lYAnae9ATEzxU=; b=KJVgZkUl32hOagv4jvfYaZ55+blGo6ug2Ei6bUPGnc2SHE5fOpqVjooLl1ci5nvSyV PduLC+bTtsrJbmTllfvF/J0m820wvfnvMgXWQgpQGq0D5qNdeSwCGVn9j2QaHX0kr2Rd aJVFoyKbozWdwEPzyB0ABLQAGyxNF9NM03/maiTeJ+6O71unkP0bIZ/EBOucbQkSRcD+ p2FQZgz3L8OuOgbYg81Ye1oDcDvTMFjSWQc+5NvEIH/OhUPJvqldtlqpPCXl816U6m8p CFvMe0oJH8mWgOHiLwj5lTsA1uopIOT5OpwGgwFI870GDIRmFphRpefof+6PfUeGXLzZ wmug== X-Gm-Message-State: AOAM532ogpzwRVQu6XhFtOJLjPGuf9bXUGTumvV/K1tObFABRWP/hPc1 tYQgRQIKEfQCjo8aJHoPKMsmeDLUpO1UN/vHhcucPyb1BQqTWCqRrTjmf5u2VJ37rhGpDWBsC3N eOIVHKabUFc1ZAVbgmw== X-Received: by 2002:a05:620a:280d:: with SMTP id f13mr3885138qkp.31.1635432640720; Thu, 28 Oct 2021 07:50:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwl/VmiWnLgOXBaYIulqCyRQGliIsfUpDjCzq0mau01Tb9OkKGJjQHF516WyA0V/ou8H8eJeA== X-Received: by 2002:a05:620a:280d:: with SMTP id f13mr3885120qkp.31.1635432640482; Thu, 28 Oct 2021 07:50:40 -0700 (PDT) Received: from [192.168.0.102] ([192.24.49.122]) by smtp.gmail.com with ESMTPSA id u11sm2186166qko.33.2021.10.28.07.50.38 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 28 Oct 2021 07:50:39 -0700 (PDT) To: gcc-patches Subject: [COMMITTED] tree-optimization/102940 - Reset scev before invoking array_checker. Message-ID: Date: Thu, 28 Oct 2021 10:50:37 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-CA X-Spam-Status: No, score=-11.5 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" As pointed out, we need to reset scev before invoking the array-checker in execute_ranger_vrp. Bootstrapped on x86_64-pc-linux-gnu with no regressions.  Pushed. Andrew From d46aeb5906b8ed7ee255cfbacc5cf9d2f56b850c Mon Sep 17 00:00:00 2001 From: Andrew MacLeod Date: Tue, 26 Oct 2021 14:43:33 -0400 Subject: [PATCH 1/3] Reset scev before invoking array_checker. Before invoking the array_checker, we need to reset scev so it will not try to access any ssa_names that the substitute and fold engine has freed. PR tree-optimization/102940 * tree-vrp.c (execute_ranger_vrp): Reset scev. --- gcc/tree-vrp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c index 38ea50303e0..dc3e250537a 100644 --- a/gcc/tree-vrp.c +++ b/gcc/tree-vrp.c @@ -4351,7 +4351,6 @@ execute_ranger_vrp (struct function *fun, bool warn_array_bounds_p) if (dump_file && (dump_flags & TDF_DETAILS)) ranger->dump (dump_file); - if (warn_array_bounds && warn_array_bounds_p) { // Set all edges as executable, except those ranger says aren't. @@ -4367,6 +4366,7 @@ execute_ranger_vrp (struct function *fun, bool warn_array_bounds_p) else e->flags |= EDGE_EXECUTABLE; } + scev_reset (); array_bounds_checker array_checker (fun, ranger); array_checker.check (); } -- 2.17.2