RFR(XS) JDK-8013830: [parfait] Uninitialised pointer 'Reachblock' may be used as argument

Niclas Adlertz niclas.adlertz at oracle.com
Wed Oct 9 02:36:35 PDT 2013


Thank you Christian.


On 2013-10-07 20:05, Christian Thalinger wrote:
> This seems to be ok.  The thing that's non-obvious is that:
>
>        if (def->rematerialize() && contains_no_live_range_input(def)) {
>
> and the logic in PhaseChaitin::split_Rematerialize with:
>
>        if (lidx < _lrg_map.max_lrg_id() && lrgs(lidx).reg() >= LRG::SPILL_REG) {
>
> are equivalent.  The assert helps, though.
>
> On Oct 7, 2013, at 10:14 AM, Niclas Adlertz <niclas.adlertz at oracle.com> wrote:
>
>> Hi,
>>
>> At row 1330 in reg_split.cpp we check if we can split by re-materializing 'def'. We only enter split_Rematerialize() at row 1341 if the 'def' node doesn't have any live range inputs (contains_no_live_range_input(def)).
>> This means that the condition at split_Rematerialize() at row 377 will never be true when entering from row 1341. Because of this we can pass in NULL at the call on row 1341 instead of the uninitialized pointer 'Reachblock'.
>>
>> Kind Regards,
>> Niclas Adlertz
>>
>>
>> On 2013-10-07 18:18, Roland Westrelin wrote:
>>> Hi Niclas,
>>>
>>>> The uninitialized pointer 'Reachblock' can be replaced with NULL at the call since the node we are re-materializing will not have any live range input (because of contains_no_live_range_input(def)).
>>>>
>>>> WEBREV: http://cr.openjdk.java.net/~adlertz/JDK-8013830/webrev00/
>>>> JBS: https://bugs.openjdk.java.net/browse/JDK-8013830
>>>
>>> Can you give more details? Which test in PhaseChaitin::split_Rematerialize() fails/succeeds so that we don't reach
>>>
>>>   378         assert(Reachblock != NULL, "Reachblock must be non-NULL");
>>>   379         Node *rdef = Reachblock[lrg2reach[lidx]];
>>>
>>> when contains_no_live_range_input(def)is true?
>>>
>>> Roland.
>>>
>>
>



More information about the hotspot-compiler-dev mailing list