RFR: 8292301: [REDO v2] C2 crash when allocating array of size too large [v6]

Roland Westrelin roland at openjdk.org
Fri Sep 23 08:08:01 UTC 2022


> On top of the redo, this fixed 2 bugs:
> 
> 8288184: the problem here is that the ValidLengthTest input of an
> AllocateArrayNode becomes a constant. The CatchNode would then change
> types if it was reprocessed but it's not. Custom logic is needed to
> enqueue the CatchNode when the ValidLengthTest input of an
> AllocateArrayNode changes. The CastII out of the AllocateArrayNode
> becomes top but the fallthrough path doesn't die. This happens with
> igvn in the case of the bug but could also happen with ccp. I fixed
> both in this patch.
> 
> 8291665: the code pattern for this is 2 AllocateArrayNodes out of loop
> with a shared ValidLengthTest input in a loop. When the loop is cloned
> that causes Phis to be added between the AllocateArrayNodes and the
> BoolNode of the ValidLengthTest inputs. Split if runs next and it
> doesn't expect the Phi at the ValidLengthTest inputs. The fix here is
> to clone the Bool/Cmp subgraph down on loop cloning. There's logic for
> that when the use of the bool is an If for instance so I simply added
> a special case to run that logic for an AllocateArrayNode use as
> well. Note that the test case I added fails reliably on 11 but not
> with the current jdk developement branch. AFAICT, the bug is there but
> something unrelated changed and a slightly different graph is built
> for the test case that prevents split if.

Roland Westrelin has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 15 commits:

 - Merge branch 'master' into JDK-8292301
 - Vladimir's review
 - Merge branch 'master' into JDK-8292301
 - comments
 - Merge branch 'master' into JDK-8292301
 - Update src/hotspot/share/opto/phaseX.cpp
   
   Co-authored-by: Tobias Hartmann <tobias.hartmann at oracle.com>
 - undo needless change
 - dos->unix test file
 - move tests
 - test fix
 - ... and 5 more: https://git.openjdk.org/jdk/compare/05c8cabd...1fe38157

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

Changes: https://git.openjdk.org/jdk/pull/10038/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=10038&range=05
  Stats: 502 lines in 19 files changed: 394 ins; 67 del; 41 mod
  Patch: https://git.openjdk.org/jdk/pull/10038.diff
  Fetch: git fetch https://git.openjdk.org/jdk pull/10038/head:pull/10038

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


More information about the hotspot-compiler-dev mailing list