RFR: 8265767: compiler/eliminateAutobox/TestIntBoxing.java crashes on arm32 after 8264649 in debug VMs
Vladimir Kozlov
kvn at openjdk.java.net
Fri Apr 30 17:49:54 UTC 2021
On Fri, 30 Apr 2021 14:17:23 GMT, Hui Shi <hshi at openjdk.org> wrote:
> This patch fix failure exposed by JDK-8264649.
>
> compiler/eliminateAutobox/TestIntBoxing.java crashes on arm32 in Compile::check_no_dead_use assertion.
> In LoadNode::eliminate_autobox, early "result" is dead after line 1450 but not added into PhaseGVN worklist for optimization.
> Its out_cnt is 0. If it isn't removed, will trigger assertion in Compile::check_no_dead_use.
>
>
> 1443 } else if (result->is_Add() && result->in(2)->is_Con() &&
> 1444 result->in(1)->Opcode() == Op_LShiftX &&
> 1445 result->in(1)->in(2) == phase->intcon(shift)) {
> 1446 // We can't do general optimization: ((X<<Z) + Y) >> Z ==> X + (Y>>Z)
> 1447 // but for boxing cache access we know that X<<Z will not overflow
> 1448 // (there is range check) so we do this optimizatrion by hand here.
> 1449 Node* add_con = new RShiftXNode(result->in(2), phase->intcon(shift));
> --- result before is dead and might not removed
> 1450 result = new AddXNode(result->in(1)->in(1), phase->transform(add_con));
> 1451 } else
>
>
> Detail analysis is in https://bugs.openjdk.java.net/browse/JDK-8265767
>
> @mychris I have verified compiler/eliminateAutobox/TestIntBoxing.java on qemu, it failed with same assertion and now passes with this fix. Would you please help verify it on arm32 machine?
>
> Testing:
> - Passed Tier1-3 on Linux x86_64, release and fastdebug build, default option and -XX:-TieredCompilation.
> - compiler/eliminateAutobox/TestIntBoxing.java on arm32 release/fastdebug/slowdebug
The fix is reasonable.
Add comment `// remove dead node later`
Pass `PhaseIterGVN* igvn` instead of `eliminate_autobox(PhaseGVN* phase)` to simplify code. Note, `can_reshape == true` only for PhaseIterGVN.
-------------
Changes requested by kvn (Reviewer).
PR: https://git.openjdk.java.net/jdk/pull/3818
More information about the hotspot-compiler-dev
mailing list