RFR: 8263164: assert(_base >= VectorA && _base <= VectorZ) failed: Not a Vector while calling StoreVectorNode::memory_size() [v4]

Vladimir Ivanov vlivanov at openjdk.java.net
Mon Mar 15 12:49:07 UTC 2021


On Mon, 15 Mar 2021 11:58:16 GMT, Jie Fu <jiefu at openjdk.org> wrote:

>>> I didn't get your point why ReductionNode also suffers from the very same problem.
>>> Could you please make it more clearer?
>> 
>> The following code experiences the very same problem, doesn't it?
>> class ReductionNode : public Node {
>> ...
>>   virtual const Type* bottom_type() const {
>>     BasicType vbt = in(1)->bottom_type()->basic_type();
>>     return Type::get_const_basic_type(vbt);
>>   }
>
>> > I didn't get your point why ReductionNode also suffers from the very same problem.
>> > Could you please make it more clearer?
>> 
>> The following code experiences the very same problem, doesn't it?
>> 
>> ```
>> class ReductionNode : public Node {
>> ...
>>   virtual const Type* bottom_type() const {
>>     BasicType vbt = in(1)->bottom_type()->basic_type();
>>     return Type::get_const_basic_type(vbt);
>>   }
>> ```
> 
> Hi @iwanowww ,
> 
> Di you mean the following assert may fail for ReductionNode?
>   static const Type* get_const_basic_type(BasicType type) {
>     assert((uint)type <= T_CONFLICT && _const_basic_type[type] != NULL, "bad type");
>     return _const_basic_type[type];
>   }
> 
> But it seems fine to pass a Type::TOP to it.
> (gdb) call Type::TOP->basic_type()
> $1 = T_VOID
> (gdb) call Type::get_const_basic_type(Type::TOP->basic_type())
> $2 = (const Type *) 0x7fff6402bc68
> 
> Am I missing something?
> 
> Thanks.
> Best regards,
> Jie

I thought that `get_const_basic_type()` would assert on `T_VOID`, but still having `ReductionNode::bottom_type()` returning a `NULL` pointer (when `in(1)` is `TOP`) may cause problems in surprising places. 

  _const_basic_type[T_VOID]        = TypePtr::NULL_PTR;   // reflection represents void this way

-------------

PR: https://git.openjdk.java.net/jdk/pull/2867


More information about the hotspot-compiler-dev mailing list