Integrated: 8261912: Code IfNode::fold_compares_helper more defensively
Aleksey Shipilev
shade at openjdk.java.net
Thu Feb 18 15:54:40 UTC 2021
On Wed, 17 Feb 2021 16:11:39 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:
> As [JDK-8261914](https://bugs.openjdk.java.net/browse/JDK-8261914) indicates, there are cases that break the internal asserts in `IfNode::fold_compares_helper`, code added by JDK-8073480 in JDK 9. Unfortunately, release builds would happily miscompile when that happens. It would be better to code `IfNode::fold_compares_helper` more defensively, so it bails when asserts are violated. This implicitly works around the bug in JDK-8261914. The goal for this limited workaround is to be trivially backportable in order to quickly unbreak 11u, 16u and 17.
>
> The alternative is, instead of the early returns is to do:
>
> lo = NULL;
> hi = NULL;
>
> ...and then wait for for the method epilog to handle it. I have no preference to either style, as the blocks this patch affects already has some early returns, and `lo/hi = NULL` are also used.
>
> Additional testing:
> - [x] Linux x86_64 fastdebug `tier1`
> - [x] Linux x86_64 fastdebug `tier2`
> - [x] Failing JRuby reproducer from JDK-8261914, now passing in release mode with hundreds of iterations
This pull request has now been integrated.
Changeset: e9f3aab7
Author: Aleksey Shipilev <shade at openjdk.org>
URL: https://git.openjdk.java.net/jdk/commit/e9f3aab7
Stats: 23 lines in 1 file changed: 15 ins; 4 del; 4 mod
8261912: Code IfNode::fold_compares_helper more defensively
Reviewed-by: kvn, thartmann
-------------
PR: https://git.openjdk.java.net/jdk/pull/2610
More information about the hotspot-compiler-dev
mailing list