RFR: 8337066: Repeated call of StringBuffer.reverse with double byte string returns wrong result

Igor Veresov iveresov at openjdk.org
Fri Sep 27 19:17:35 UTC 2024


On Fri, 27 Sep 2024 18:57:55 GMT, Igor Veresov <iveresov at openjdk.org> wrote:

>> src/hotspot/share/opto/gcm.cpp line 753:
>> 
>>> 751:   // root of our search tree through the corresponding slices of MergeMem nodes to
>>> 752:   // get to the node that really creates the memory state for this slice.
>>> 753:   if (load_alias_idx >= Compile::AliasIdxRaw) {
>> 
>> This will be executed for all loads and not only pinned. Is this okay?
>
> Normally loads would not have a MergeMem as their memory input at this stage. `Ideal()` splits the memory, so that the memory input of a load is as precise as possible. So I think, that loop is benign for a regular load.

Also if there is a MergeMem as a root for some weird reason then `insert_anti_dependencies()` may very well miss an interfering store. So we'd have to do this loop for correctness.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/21222#discussion_r1779049266


More information about the hotspot-compiler-dev mailing list