From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 Cc: gcc-patches References: <51d7f2dc-e7ff-d136-aacc-7d3a4fb28dc4@redhat.com> <0D8A2269-0C8E-48A7-B117-AAC107EE0C4B@linaro.org> From: Andrew MacLeod 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-Type: multipart/mixed; boundary="------------E9317473F1224D39C838A7A3" 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-List-Received-Date: Wed, 16 Jun 2021 17:14:46 -0000 This is a multi-part message in MIME format. --------------E9317473F1224D39C838A7A3 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit 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 --------------E9317473F1224D39C838A7A3 Content-Type: text/x-patch; charset=UTF-8; name="unin.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="unin.diff" 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 () --------------E9317473F1224D39C838A7A3--