JDK-8216050 : Superword optimization fails with assert(0 <= i && i < _len) failed: illegal index
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 12,13
  • Priority: P1
  • Status: Closed
  • Resolution: Fixed
  • CPU: x86
  • Submitted: 2019-01-03
  • Updated: 2019-08-15
  • Resolved: 2019-01-15
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 12 JDK 13
12 b28Fixed 13Fixed
Related Reports
Relates :  
Relates :  
Description
compiler/loopopts/superword/Vec_MulAddS2I.java which was added by JDK-8214751 fails with:

#  Internal Error (/scratch/opt/mach5/mesos/work_dir/slaves/2dd962d0-8988-479b-a804-57ab764ada59-S1353/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/d26c32e8-05d9-4787-b754-e5456974cf17/runs/73c1981f-1250-4aba-82b4-db71d0fede8c/workspace/open/src/hotspot/share/utilities/growableArray.hpp:240), pid=22071, tid=22084
#  assert(0 <= i && i < _len) failed: illegal index

Current CompileTask:
C2:    254   16 %     4       compiler.loopopts.superword.Vec_MulAddS2I::Vec_MulAddS2IImplement @ 2 (70 bytes)

Stack: [0x00007fb4d9bfc000,0x00007fb4d9cfd000],  sp=0x00007fb4d9cf6750,  free space=1001k
Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0x16f337f]  GrowableArray<int>::at(int) [clone .isra.226]+0x1f
V  [libjvm.so+0x170f0dd]  SuperWord::bb_idx(Node*)+0x6d
V  [libjvm.so+0x170f433]  SuperWord::my_pack(Node*)+0x53
V  [libjvm.so+0x16f7a2a]  SuperWord::vector_opd(Node_List*, int)+0x23a
V  [libjvm.so+0x17072e8]  SuperWord::output()+0x2f8
V  [libjvm.so+0x170e688]  SuperWord::SLP_extract()+0x2d8
V  [libjvm.so+0x170ed63]  SuperWord::transform_loop(IdealLoopTree*, bool)+0x463
V  [libjvm.so+0x125deba]  PhaseIdealLoop::build_and_optimize(LoopOptsMode)+0x11fa
V  [libjvm.so+0x9fe9f2]  Compile::optimize_loops(PhaseIterGVN&, LoopOptsMode) [clone .part.412]+0x2c2
V  [libjvm.so+0xa01d41]  Compile::Optimize()+0xc21
V  [libjvm.so+0xa02dbc]  Compile::Compile(ciEnv*, C2Compiler*, ciMethod*, int, bool, bool, bool, DirectiveSet*)+0xd6c
V  [libjvm.so+0x8044e1]  C2Compiler::compile_method(ciEnv*, ciMethod*, int, DirectiveSet*)+0xd1
V  [libjvm.so+0xa0ffc9]  CompileBroker::invoke_compiler_on_method(CompileTask*)+0x409
V  [libjvm.so+0xa110e8]  CompileBroker::compiler_thread_loop()+0x458
V  [libjvm.so+0x17b06c7]  JavaThread::thread_main_inner()+0x2c7
V  [libjvm.so+0x17b099c]  JavaThread::run()+0x1cc
V  [libjvm.so+0x17ac605]  Thread::call_run()+0x75
V  [libjvm.so+0x1497376]  thread_native_entry(Thread*)+0x106
Comments
The test passes in mach5
12-02-2019

Webrev: http://cr.openjdk.java.net/~vdeshpande/8216050/webrev.01/ This has 2 fixes. 1) Fix for the crash by matching the operand by swapping to right positions. 2) Cost based generation of vpdpwssd instruction.
11-01-2019

Webrev: http://cr.openjdk.java.net/~vdeshpande/8216050/webrev.00/ This has 3 fixes. 1) Fix for the crash by matching the operand by swapping to right positions. 2) Cost based generation of vpdpwssd instruction. 3) Fix generation of vector code by allowing adjacent LoadS nodes to be isomorphic when they have different control rangeCheck nodes for a[i] and a[i+1] accesses in same MulAddS2I node.
11-01-2019

I can reproduce this with replay compilation: -XX:+ReplayIgnoreInitErrors -XX:+ReplayCompiles -XX:+PrintCompilation -XX:ReplayDataFile=replay_pid22071.log -XX:LoopUnrollLimit=250 The call to vector_opd() was added by JDK-8214751: http://hg.openjdk.java.net/jdk/jdk/rev/4bb6e0871bf7#l14.95 ILW = Assert during compilation (regression in JDK 12 b24), easy to reproduce with regression test, disable vectorization (-XX:-UseSuperWord) or compilation of affected method = HHM = P1
03-01-2019

Vivek, could you please have a look?
03-01-2019