From patchwork Tue Nov 1 18:04:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrew MacLeod X-Patchwork-Id: 1697862 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org 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=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: legolas.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=DiWDWjKe; dkim-atps=neutral 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 ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4N1yby4vqcz23l6 for ; Wed, 2 Nov 2022 05:05:17 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 869CB38576A3 for ; Tue, 1 Nov 2022 18:05:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 869CB38576A3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1667325913; bh=eKtjsySs9ohCrC5JjCJpUoxcIRlxpPl4EyQbTun4XuY=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=DiWDWjKeQrluK8G4zPg8YJTLcMxjFy1gW5RTdcaF4Or3lePAQMGGbfu377sht8wTK Dkq2VNS51EwJWiPuIvUfecqlQAX+0vmWdaOaZy35hLwaPOsCgnYtkAsc+U64XDlUJY zRx/HmcOzQ46E1yDl/n4DviTtxFU8i9PlvuFmEhU= 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.129.124]) by sourceware.org (Postfix) with ESMTPS id 186F1385769F for ; Tue, 1 Nov 2022 18:04:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 186F1385769F Received: from mail-il1-f197.google.com (mail-il1-f197.google.com [209.85.166.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-533-dYr3HB1tPvaXm9LYEAA5-g-1; Tue, 01 Nov 2022 14:04:44 -0400 X-MC-Unique: dYr3HB1tPvaXm9LYEAA5-g-1 Received: by mail-il1-f197.google.com with SMTP id h20-20020a056e021d9400b00300581edaa5so14765719ila.12 for ; Tue, 01 Nov 2022 11:04:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=YP/hIXY54t8FNfk+uIghFqGDeTa8BAueFDyP/drqU3E=; b=Xg6O80+pnYCFDXy9/SwwtaCANvW7zD/Y/hk+T2cV1TaxtcrSTASSeHBip36oxOMRjN 3c1jyv+/G6v0Qg3qQfkKlu5ISc6j4lLN3bE5aKG9FoypFWZtil3op/VvnFGvoc+xnSlR 8Za/2fB6Sqg70kNec+iZ4y8+ecWDXFB4xMCYF1VRbpPjLJ5DKSvIlyUS7+Z1MtQIY3GC cgVrqDeEFPnOk8OVmz33GxQeGv6K95Ob4NcCI86HVSSwSEY/90RYOPy5W8AQpunv4Tmk +Rj8i4dLjgUA8cYUODsEfCEwom3G5G0wKq6R2klJijX3trwYQNnJ5dbK2XRdRYMxWtSZ nCsQ== X-Gm-Message-State: ACrzQf1dwohaOCN7gX14js8AJ85is0llFO21X9KOSWPIRhtrK4QAifNn 1XTIbvK56B77WePMBDYO1fpwo2IrATdV6xl+DQe2r3idhskSB/V+LWvAXFJHIZDJ7ZPOQTaIrdF 0S6jUs76p7Tu3SsPtXcTKG/ULX/BjY02CsDrOUbrVJr6RnUmrJKbRY4KtCaGjQduYRimpwQ== X-Received: by 2002:a92:6912:0:b0:300:c48d:19cd with SMTP id e18-20020a926912000000b00300c48d19cdmr2806614ilc.216.1667325882804; Tue, 01 Nov 2022 11:04:42 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4Xa+yP/4eOW3NlPpFyP/I3bUKuLVQj187vfHfbCpR82F+7fl4ho6AeHhWmu673rgr2/LEJ/Q== X-Received: by 2002:a92:6912:0:b0:300:c48d:19cd with SMTP id e18-20020a926912000000b00300c48d19cdmr2806603ilc.216.1667325882522; Tue, 01 Nov 2022 11:04:42 -0700 (PDT) Received: from ?IPV6:2607:fea8:a263:f600::72c3? ([2607:fea8:a263:f600::72c3]) by smtp.gmail.com with ESMTPSA id ca11-20020a0566381c0b00b003711ce0dc15sm4106486jab.68.2022.11.01.11.04.40 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 01 Nov 2022 11:04:40 -0700 (PDT) Message-ID: Date: Tue, 1 Nov 2022 14:04:38 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.1 To: gcc-patches Subject: [COMMITTED] PR tree-optimization/107497 - Make sure ssa-name is valid. X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US X-Spam-Status: No, score=-12.3 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_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 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" pushed as obvious.   Testing running. Andrew commit 82b0345f6137b112728590d7c010dcd2cef08514 Author: Andrew MacLeod Date: Tue Nov 1 13:18:33 2022 -0400 Make sure ssa-name is valid. PR tree-optimization/107497 * tree-vrp.cc (remove_unreachable::remove_and_update_globals): Check that ssa-name still exists before accessing it. diff --git a/gcc/tree-vrp.cc b/gcc/tree-vrp.cc index f0e4d37bef0..39f7eb7a75e 100644 --- a/gcc/tree-vrp.cc +++ b/gcc/tree-vrp.cc @@ -180,7 +180,7 @@ remove_unreachable::remove_and_update_globals (bool final_p) bitmap_copy (dce, all_exports); // Don't attempt to DCE parameters. EXECUTE_IF_SET_IN_BITMAP (all_exports, 0, i, bi) - if (SSA_NAME_IS_DEFAULT_DEF (ssa_name (i))) + if (!ssa_name (i) || SSA_NAME_IS_DEFAULT_DEF (ssa_name (i))) bitmap_clear_bit (dce, i); simple_dce_from_worklist (dce);