JDK-7199010 : incorrect vector alignment
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: hs25
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2012-09-17
  • Updated: 2013-06-26
  • Resolved: 2012-09-20
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 7 JDK 8 Other
7u40Fixed 8Fixed hs24Fixed
Related Reports
Relates :  
Several vector jtreg tests timeout on SPARC with 32-bit VM:

compiler/7119644/TestByteFloatVect.java   Error. Program `java' interrupted! (timed out?)
compiler/7119644/TestByteIntVect.java     Error. Program `java' interrupted! (timed out?)
compiler/7119644/TestShortFloatVect.java  Error. Program `java' interrupted! (timed out?)
compiler/7119644/TestShortIntVect.java    Error. Program `java' interrupted! (timed out?)

SUGGESTED FIX Vector memory operations could be misaligned when accesses to arrays of different types are vectorized in one loop. It leads to hw trap on SPARC and slow performance on old x86 (with slow unaligned memory instructions). It was caused by 2 main reasons: using iv_adjustment_in_bytes instead of iv_adjustment (number of iterations) and typo in same_velt_type(). Fixes: Used iv_adjustment as number of iterations in pre-loop to calculate correct offset in SuperWord::memory_alignment() method. Fixed typo in SuperWord::same_velt_type(). Allowed misaligned memory operations for vectors only on x86 which have fast misaligned memory instructions. I also did some code style clean up there. Note, the flag AlignVector is used in x64.ad file: const bool Matcher::misaligned_vectors_ok() { return !AlignVector; } Excluded LoadUI2L node from vector operations because it reports incorrect memory size.

EVALUATION http://hg.openjdk.java.net/hsx/hotspot-comp/hotspot/rev/8ae8f9dd7099

EVALUATION Vector memory operations are misaligned for one of arrays (float[] in the test below) in a loop which cause hw trap: command: main -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation -XX:-OptimizeFill TestByteFloatVect reason: User specified action: run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation -XX:-OptimizeFill TestByteFloatVect elapsed time (seconds): 300.05 STDOUT: Testing Byte + Float vectors Warmup Verification Time test_ci: 20947 test_vi: 21020 test_cp: 42160 test_ci_neg: 76 test_vi_neg: 78 test_cp_neg: 74 test_ci_oppos: 63 test_vi_oppos: 77 test_cp_oppos: 329 STDERR: TEST RESULT: Error. Program `java' interrupted! (timed out?)