RFR: 8297294: compiler/c2/irTests/TestMulNodeIdealization.java failed compilation

Archie L. Cobbs duke at openjdk.org
Wed Nov 30 18:24:25 UTC 2022

On Wed, 30 Nov 2022 17:20:45 GMT, Vicente Romero <vromero at openjdk.org> wrote:

> Given that the reported issue is intermittent I think we have two options here:
> - change the most probable use of a non-deterministic data structure that could be provoking this bug, to a deterministic one
> - change all uses of non-deterministic data structures
> The current fix is going for the first option, if preferred I can provide another patch that fixes all uses of non-deterministic data structures in our inference engine. I don't think we will have any performance impact going for the second option but it could be unnecessary.
> Comments?

So just to confirm: while clearly changing `HashSet` to `LinkedHashSet` is going to eliminate some non-determinism, it also fixes the actual compiler logic bug rather than "papering over" it, correct?

If not - then is more investigation warranted?

If so - then doesn't that imply that the code that invokes `closure()` contains an implicit assumption about the ordering of the elements of that returned `Set`? And if so, since that's a fairly subtle and suspicious assumption about a `Set`, shouldn't that assumption least be documented in a comment somewhere (or ideally, corrected by sorting the `Set` into a `List` or something)? Otherwise it seems a variant of this bug could easily crop up again.


PR: https://git.openjdk.org/jdk/pull/11437

More information about the compiler-dev mailing list