JDK-8150517 : FoldStableValues code needs to be revisited for compressed strings
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 9
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • Submitted: 2016-02-24
  • Updated: 2020-09-01
  • Resolved: 2016-02-24
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 9
9Resolved
Related Reports
Duplicate :  
Relates :  
Description
I get this crash:

Internal Error at phaseX.cpp:1655, pid=39486, tid=39571
assert(t->meet(t0) == t) failed: Not monotonic

CCP is processing:
793 LoadUS  ===  652  700  791  [[ 800 ]]  @byte[int:>=0]:exact+any *, idx=14; mismatched #char !jvms: StringUTF16::charAt @ bci:23 String::charAt @ bci:21 UnEqualClasses::init @ bci:100

t is char
t0 is int:-80

It seems the code in LoadNode::Value()/fold_stable_ary_elem() for FoldStableValues is broken for compressed strings: it reads a single byte  from the array instead of a char
Comments
Reproduced on latest hs-comp. This is resolved with a candidate fix for JDK-8150186. Closing as duplicate.
24-02-2016

This looks like a duplicate for JDK-8150186.
24-02-2016

Wait, but I thought we have a special-case in StringUTF16.getChar intrinsic that should avoid this very issue. Looking...
24-02-2016

This is triggered by the fix for JDK-8150180 which add the @Stable annotation to String.value. Therefore this is an integration blocker. We should either back out the fix for JDK-8150180 or fix this before pushing to main. [~shade], can you have a look?
24-02-2016