[jdk16] RFR: 8258790: C2: Crash on empty macro node list

Vladimir Kozlov kvn at openjdk.java.net
Mon Dec 21 20:13:59 UTC 2020


On Mon, 21 Dec 2020 19:22:52 GMT, Vladimir Ivanov <vlivanov at openjdk.org> wrote:

> The fix for 8257624 is incomplete: it doesn't cover the case when macro node array becomes empty as a result of multiple nodes removal. In such case, the out-of-bounds access still takes place (at index "-1"). 
> 
> Proposed fix is to adjust the index before performing "i > 0" check.    
> 
> Testing:
> - [x] failing tests
> - [ ] hs-precheckin-comp, hs-tier1, hs-tier2

Marked as reviewed by kvn (Reviewer).

src/hotspot/share/opto/macro.cpp line 2566:

> 2564:   while (progress) {
> 2565:     progress = false;
> 2566:     for (int i = C->macro_count(); i > 0; i = MIN2(i-1, C->macro_count())) { // more than 1 element can be eliminated at once

Please, add spaces around **-** in this and following line: `(i - 1`
Otherwise it is good.

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

PR: https://git.openjdk.java.net/jdk16/pull/56


More information about the hotspot-compiler-dev mailing list