diff mbox series

Avoid loading an undefined value in the ranger_cache constructor.

Message ID ec284494-7f71-1212-acc8-ee5f306fc4c6@redhat.com
State New
Headers show
Series Avoid loading an undefined value in the ranger_cache constructor. | expand

Commit Message

Andrew MacLeod June 16, 2021, 5:14 p.m. UTC
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

Comments

Maxim Kuvyrkov June 17, 2021, 8:01 a.m. UTC | #1
> On 16 Jun 2021, at 20:14, Andrew MacLeod <amacleod@redhat.com> wrote:
> 
> 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.
> 

Hi Andrew,

All good, thanks!  CI is back to green.

--
Maxim Kuvyrkov
https://www.linaro.org
diff mbox series

Patch

commit bdfc1207bd20cf1ad81fca121e4f7df4995cc0d6
Author: Andrew MacLeod <amacleod@redhat.com>
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 ()