RFR: 8265767: compiler/eliminateAutobox/TestIntBoxing.java crashes on arm32 after 8264649 in debug VMs

Hui Shi hshi at openjdk.java.net
Fri Apr 30 14:24:10 UTC 2021

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?

- 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


Commit messages:
 - 8265767: compiler/eliminateAutobox/TestIntBoxing.java crashes on arm32 after 8264649 in debug VMs

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

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

More information about the hotspot-compiler-dev mailing list