From patchwork Wed Jun 16 17:14:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew MacLeod X-Patchwork-Id: 1493016 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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=) Authentication-Results: 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=y3a13RUH; 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 RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4G4sKr3CSJz9sWl for ; Thu, 17 Jun 2021 03:16:30 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 06A6E3986C25 for ; Wed, 16 Jun 2021 17:16:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 06A6E3986C25 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1623863788; bh=/fUSiAeDsgPQl3MM4cv8/an0h9hVl9Md9+4uoGPJR1c=; h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=y3a13RUHffGdQDSpQDFQDGewf8k/bhkMK2KQTWUr82nHBrEc2Dy+BD6HhtzJLG3pK qXJ89C4oyKDd1C2YPsCqQ9YG6LC5XgNRb/sghNDpaqDImzDUQ2h3MK0fH9Bz/ZPDFK vqbXF0fnpkUoO/S2rFVsTqEbzRUv4kfg2qLap4Gw= 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 E485E3988039 for ; Wed, 16 Jun 2021 17:14:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E485E3988039 Received: from mail-qv1-f69.google.com (mail-qv1-f69.google.com [209.85.219.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-186-KNgtj89oMJqROTcwmdXoBA-1; Wed, 16 Jun 2021 13:14:42 -0400 X-MC-Unique: KNgtj89oMJqROTcwmdXoBA-1 Received: by mail-qv1-f69.google.com with SMTP id v7-20020a0ccd870000b0290219d3e21c4eso113725qvm.2 for ; Wed, 16 Jun 2021 10:14:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language; bh=/fUSiAeDsgPQl3MM4cv8/an0h9hVl9Md9+4uoGPJR1c=; b=HC1VODR9UI9AKYmDxSl5aCZkYyBdQCgF1eO4P6eXZ0JPUAQjSl9Vs85ZqR2IBee//b GHn+sXXhUV+JSoSaIGgTmQoHDRwp+MAEooilL4gEA2seVCBb1G+Hp3XZmVDfY/DIIpZm VizVg3Is5c1dZnoUqen6hYv6h3GG/9vFGHMlkFfiIcuwe/n6P8ftStdUHhPmxzP5N7iJ 6UHlEC69QlhG+PYQ7OANkm//mjrj6d4mfnZ9kyXRJwYPXwjNCCVfmQ/MA7e9hs4l7yjI HzP7PBSoGz9/h3/VxuEZ6s41OvlSibbS+oPW3gzDO/bcBed1emXKTTpoIhEkxdEdDQO3 wunA== X-Gm-Message-State: AOAM532NvfwbWnWmOi3wcKbUk/K4tQdEM5okSn3m+GcJ7e8ltRjAKrrA hop2Im7nojmDkoWJAYSPWstFdOcd4Sw7aNaxOhWd/N56TVvamwbp6LaN86eMBYYt/tfmD6olGrd 6GZTipWFcKLY8I5Vux6u8x4TnF1N7Bg8aBWHD3jxylX7CZWxssGoENMwg+hparoz0D6Pddw== X-Received: by 2002:ac8:74d6:: with SMTP id j22mr858958qtr.81.1623863681559; Wed, 16 Jun 2021 10:14:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJygPUXVvyCW6eymrrd5W7PWMkPwveXkFoOt+FgdJupkvuaOY+nbbB13RpmdazHTrbQqsr1RZA== X-Received: by 2002:ac8:74d6:: with SMTP id j22mr858935qtr.81.1623863681244; Wed, 16 Jun 2021 10:14:41 -0700 (PDT) Received: from ?IPv6:2607:fea8:a241:4600::58f9? ([2607:fea8:a241:4600::58f9]) by smtp.gmail.com with ESMTPSA id k124sm1962029qkc.132.2021.06.16.10.14.39 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 16 Jun 2021 10:14:40 -0700 (PDT) Subject: [PATCH] Avoid loading an undefined value in the ranger_cache constructor. To: Maxim Kuvyrkov References: <51d7f2dc-e7ff-d136-aacc-7d3a4fb28dc4@redhat.com> <0D8A2269-0C8E-48A7-B117-AAC107EE0C4B@linaro.org> Message-ID: Date: Wed, 16 Jun 2021 13:14:38 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.0 MIME-Version: 1.0 In-Reply-To: <0D8A2269-0C8E-48A7-B117-AAC107EE0C4B@linaro.org> 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_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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 Cc: gcc-patches Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" On 6/16/21 5:41 AM, Maxim Kuvyrkov wrote: > >> + m_new_value_p = state; >> + return ret; >> } >> >> // Dump the caches for basic block BB to file F. > Thanks, > > -- > Maxim Kuvyrkov > https://www.linaro.org > Let me know if the problem is resolved. pushed as obvious. Andrew commit bdfc1207bd20cf1ad81fca121e4f7df4995cc0d6 Author: Andrew MacLeod Date: Wed Jun 16 13:01:21 2021 -0400 Avoid loading an undefined value in the ranger_cache constructor. Enable_new_values takes a boolean, returning the old value. The constructor for ranger_cache initialized the m_new_value_p field by calling this routine and ignorng the result. This potentially loads the old value uninitialized. * gimple-range-cache.cc (ranger_cache::ranger_cache): Initialize m_new_value_p directly. diff --git a/gcc/gimple-range-cache.cc b/gcc/gimple-range-cache.cc index d9a57c294df..37e2acb19f9 100644 --- a/gcc/gimple-range-cache.cc +++ b/gcc/gimple-range-cache.cc @@ -727,7 +727,7 @@ ranger_cache::ranger_cache (gimple_ranger &q) : query (q) if (bb) m_gori.exports (bb); } - enable_new_values (true); + m_new_value_p = true; } ranger_cache::~ranger_cache ()