On Tue, 23 Jun 2026 03:10:18 GMT, Gui Cao <[email protected]> wrote:

>> David Simms has updated the pull request with a new target base due to a 
>> merge or a rebase. The pull request now contains 2822 commits:
>> 
>>  - Merge branch '8317277' into jep401_sub_review_8317278
>>  - Merge remote-tracking branch 'valhalla/lworld' into 8317277
>>  - 8386690: [lworld] cherry-pick JDK-8386124 Test 
>> serviceability/sa/TestG1HeapRegion.java failed: Address of G1HeapRegion does 
>> not match
>>    
>>    Reviewed-by: liach
>>  - 8385743: [lworld] investigate and address build related comments in the 
>> Valhalla PR
>>    
>>    Reviewed-by: liach, erikj
>>  - 8376346: [lworld] Basic Shenandoah support
>>    
>>    Reviewed-by: qamai
>>  - 8386598: [lworld] C1 acmp profiling fix and minor cleanup
>>    
>>    Reviewed-by: mchevalier
>>  - 8386618: [lworld] Remove unused entry_guard_Relocation
>>    
>>    Reviewed-by: chagedorn, jsjolen, jsikstro
>>  - Merge
>>    
>>    Merge jdk-28+2
>>  - 8386623: [lworld] Cleanup module support for system modules in JDK 
>> exploded build with preview resources
>>    
>>    Reviewed-by: liach
>>  - 8386316: [lworld] Replace Valhalla since version with 28
>>    
>>    Reviewed-by: darcy
>>  - ... and 2812 more: https://git.openjdk.org/jdk/compare/6def7d55...c2d3cf01
>
> src/hotspot/share/c1/c1_LIRGenerator.cpp line 2391:
> 
>> 2389:       assert(x->delayed() == nullptr, "Delayed LoadIndexed only apply 
>> to loaded_flat_arrays");
>> 2390:       index.load_item();
>> 2391:       // if we are loading from a flat array, load it using a runtime 
>> call
> 
> Hi, I was failing this test on RISC-V, and the C1 log indicates that it's 
> related to the code here.
> 
> import java.util.*;
> 
> public class ArrayFlatteningTest {
>     // Simplified binarySort pattern
>     static <T> void mySort(T[] a, int lo, int hi, Comparator<? super T> c) {
>         for (int start = lo + 1; start < hi; start++) {
>             T pivot = a[start];
>             int left = lo;
>             int right = start;
>             while (left < right) {
>                 int mid = (left + right) >>> 1;
>                 if (c.compare(pivot, a[mid]) < 0)
>                     right = mid;
>                 else
>                     left = mid + 1;
>             }
>             int n = start - left;
>             switch (n) {
>                 case 2:  a[left + 2] = a[left + 1];
>                 case 1:  a[left + 1] = a[left];
>                          break;
>                 default: System.arraycopy(a, left, a, left + 1, n);
>             }
>             a[left] = pivot;
>         }
>     }
> 
>     public static void main(String[] args) {
>         Comparator<Integer> cmp = new Comparator<Integer>() {
>             public int compare(Integer o1, Integer o2) {
>                 return o1.compareTo(o2);
>             }
>         };
>         Random rnd = new Random(42);
>         for (int i = 0; i < 10000; i++) {
>             Integer[] arr = new Integer[32];
>             for (int j = 0; j < arr.length; j++) {
>                 arr[j] = Integer.valueOf(rnd.nextInt());
>             }
>             mySort(arr, arr.length / 3, arr.length / 2, cmp);
>         }
>         System.out.println("SUCCESS");
>     }
> }
> 
> 
> C1 log like this:
> 
> CompileCommand: compileonly ArrayFlatteningTest.mySort intx compileonly = 1111
> LIR:
> B14 [0, 0] sux: B15
> __id_Instruction___________________________________________
>    0 label [label:0x00007f8f9c031f90]
>    2 std_entry
>      move [c_rarg1|L] [stack:8|L]
>      move [c_rarg2|I] [stack:15|I]
>      move [c_rarg3|I] [stack:14|I]
>      move [c_rarg4|L] [stack:12|L]
>   12 branch [AL]   [B15]
> 
> B15 std [0, 0] preds: B14 sux: B0
> __id_Instruction___________________________________________
>   14 label [label:0x00007f8f9c032218]
>   16 branch [AL]   [B0]
> 
> B0 std [0, 5] preds: B15 sux: B1
> __id_Instruction___________________________________________
>   18 l...

Would you mind filing a Valhalla lworld bug for this?  Also, any idea why this 
hit RISC-V and not other ports?  Maybe we need a new test that can reproduce it 
on other platforms.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/31122#discussion_r3463801313

Reply via email to