RFR: 8263448: CTW: fatal error: meet not symmetric

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

RFR: 8263448: CTW: fatal error: meet not symmetric

Vladimir Kozlov-2
In bug's case instance_id should be changed to InstanceBot only if it is real id and not InstanceTop or InstanceBot (similar to Constant in type lattice). Otherwise we incorrectly change InstanceTop to InstanceBot.  In short, we should follow PTR transformation in this code:
      if (ptr == Constant) {
         ptr = NotNull;
      }
-     instance_id = InstanceBot;
+     if (instance_id > 0) {
+       instance_id = InstanceBot;
+     }
I noticed that `TypeInstPtr::xmeet_helper()` has the same code as `TypeAryPtr::xmeet_helper()` for case when `InstPtr` meets `AryPtr`. So instead of fixing two places I decided to call TypeAryPtr::xmeet_helper() from `TypeInstPtr::xmeet_helper()` for this case. We do similar thing in `TypeOopPtr::xmeet()`:
https://github.com/openjdk/jdk/blob/master/src/hotspot/share/opto/type.cpp#L3283

Fixed code style in touched code.

Tested failing test from bug report, hs-tier1-4, hs-comp.

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

Commit messages:
 - 8263448: CTW: fatal error: meet not symmetric

Changes: https://git.openjdk.java.net/jdk/pull/3298/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=3298&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8263448
  Stats: 67 lines in 1 file changed: 9 ins; 42 del; 16 mod
  Patch: https://git.openjdk.java.net/jdk/pull/3298.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/3298/head:pull/3298

PR: https://git.openjdk.java.net/jdk/pull/3298
Reply | Threaded
Open this post in threaded view
|

Re: RFR: 8263448: CTW: fatal error: meet not symmetric

Roland Westrelin-4
On Wed, 31 Mar 2021 23:31:05 GMT, Vladimir Kozlov <[hidden email]> wrote:

> In bug's case instance_id should be changed to InstanceBot only if it is real id and not InstanceTop or InstanceBot (similar to Constant in type lattice). Otherwise we incorrectly change InstanceTop to InstanceBot.  In short, we should follow PTR transformation in this code:
>       if (ptr == Constant) {
>          ptr = NotNull;
>       }
> -     instance_id = InstanceBot;
> +     if (instance_id > 0) {
> +       instance_id = InstanceBot;
> +     }
> I noticed that `TypeInstPtr::xmeet_helper()` has the same code as `TypeAryPtr::xmeet_helper()` for case when `InstPtr` meets `AryPtr`. So instead of fixing two places I decided to call TypeAryPtr::xmeet_helper() from `TypeInstPtr::xmeet_helper()` for this case. We do similar thing in `TypeOopPtr::xmeet()`:
> https://github.com/openjdk/jdk/blob/master/src/hotspot/share/opto/type.cpp#L3283
>
> Fixed code style in touched code.
>
> Tested failing test from bug report, hs-tier1-4, hs-comp.

Looks good to me.

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

Marked as reviewed by roland (Reviewer).

PR: https://git.openjdk.java.net/jdk/pull/3298
Reply | Threaded
Open this post in threaded view
|

Re: RFR: 8263448: CTW: fatal error: meet not symmetric

Vladimir Kozlov-2
On Thu, 1 Apr 2021 07:12:38 GMT, Roland Westrelin <[hidden email]> wrote:

>> In bug's case instance_id should be changed to InstanceBot only if it is real id and not InstanceTop or InstanceBot (similar to Constant in type lattice). Otherwise we incorrectly change InstanceTop to InstanceBot.  In short, we should follow PTR transformation in this code:
>>       if (ptr == Constant) {
>>          ptr = NotNull;
>>       }
>> -     instance_id = InstanceBot;
>> +     if (instance_id > 0) {
>> +       instance_id = InstanceBot;
>> +     }
>> I noticed that `TypeInstPtr::xmeet_helper()` has the same code as `TypeAryPtr::xmeet_helper()` for case when `InstPtr` meets `AryPtr`. So instead of fixing two places I decided to call TypeAryPtr::xmeet_helper() from `TypeInstPtr::xmeet_helper()` for this case. We do similar thing in `TypeOopPtr::xmeet()`:
>> https://github.com/openjdk/jdk/blob/master/src/hotspot/share/opto/type.cpp#L3283
>>
>> Fixed code style in touched code.
>>
>> Tested failing test from bug report, hs-tier1-4, hs-comp.
>
> Looks good to me.

Thank you, Roland.

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

PR: https://git.openjdk.java.net/jdk/pull/3298
Reply | Threaded
Open this post in threaded view
|

Integrated: 8263448: CTW: fatal error: meet not symmetric

Vladimir Kozlov-2
In reply to this post by Vladimir Kozlov-2
On Wed, 31 Mar 2021 23:31:05 GMT, Vladimir Kozlov <[hidden email]> wrote:

> In bug's case instance_id should be changed to InstanceBot only if it is real id and not InstanceTop or InstanceBot (similar to Constant in type lattice). Otherwise we incorrectly change InstanceTop to InstanceBot.  In short, we should follow PTR transformation in this code:
>       if (ptr == Constant) {
>          ptr = NotNull;
>       }
> -     instance_id = InstanceBot;
> +     if (instance_id > 0) {
> +       instance_id = InstanceBot;
> +     }
> I noticed that `TypeInstPtr::xmeet_helper()` has the same code as `TypeAryPtr::xmeet_helper()` for case when `InstPtr` meets `AryPtr`. So instead of fixing two places I decided to call TypeAryPtr::xmeet_helper() from `TypeInstPtr::xmeet_helper()` for this case. We do similar thing in `TypeOopPtr::xmeet()`:
> https://github.com/openjdk/jdk/blob/master/src/hotspot/share/opto/type.cpp#L3283
>
> Fixed code style in touched code.
>
> Tested failing test from bug report, hs-tier1-4, hs-comp.

This pull request has now been integrated.

Changeset: 6e0da996
Author:    Vladimir Kozlov <[hidden email]>
URL:       https://git.openjdk.java.net/jdk/commit/6e0da996
Stats:     67 lines in 1 file changed: 9 ins; 42 del; 16 mod

8263448: CTW: fatal error: meet not symmetric

Reviewed-by: roland

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

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