- Notifications
You must be signed in to change notification settings - Fork 15.1k
Description
| Bugzilla Link | 42603 |
| Resolution | INVALID |
| Resolved on | Jul 25, 2019 04:55 |
| Version | 8.0 |
| OS | OpenBSD |
| Blocks | #41819 |
| CC | @dwblaikie,@zygoloid |
Extended Description
Summary:
Building OpenJDK 11u on OpenBSD/i386 in fastdebug mode fails due to miss optimization of stubRoutines.cpp at -O2 or -O3. Building this file with -O1 corrects the issue.
Details:
When OpenJDK is built in fastdebug mode on OpenBSD/i386, some test code is enabled in stubRoutines.cpp (test_arraycopy_func). This test code aligns a pointer to 8 bytes (align_up), then calls another function via a pointer that was passed as an argument to test_arraycopy_func. The called function checks the alignment (is_aligned). When compiled at -O2 or higher the align_up has been optimized away incorrectly and the called method fails its alignment check. Reducing optimization level to -O1 results in correct output where the pointer has been aligned.
I have bisected the compile at -O2 and found that the output works up to pass 5170 but fails if higher. However, in order to do this I had to apply the patch from bug 42584:
https://bugs.llvm.org/attachment.cgi?id=22229
The preprocessed source for this crash is 11MB and is too big to attach (even when compressed). The preprocessed source and build script can be downloaded here:
http://www.intricatesoftware.com/distfiles/clang++.openjdk.stubRoutines.tar.gz
Here is some of the BISECT context. Including pass 5171 results in the miss optimization:
BISECT: running pass (5116) Simplify the CFG on function (Z8align_upImiET_S0_T0)
BISECT: running pass (5117) Combine redundant instructions on function (Z8align_upImiET_S0_T0)
BISECT: running pass (5118) Tail Call Elimination on function (Z8align_upImiET_S0_T0)
BISECT: running pass (5119) Simplify the CFG on function (Z8align_upImiET_S0_T0)
BISECT: running pass (5120) Reassociate expressions on function (Z8align_upImiET_S0_T0)
BISECT: running pass (5121) Simplify the CFG on function (Z8align_upImiET_S0_T0)
BISECT: running pass (5122) Combine redundant instructions on function (Z8align_upImiET_S0_T0)
BISECT: running pass (5123) MergedLoadStoreMotion on function (Z8align_upImiET_S0_T0)
BISECT: running pass (5124) Global Value Numbering on function (Z8align_upImiET_S0_T0)
BISECT: running pass (5125) MemCpy Optimization on function (Z8align_upImiET_S0_T0)
BISECT: running pass (5126) Sparse Conditional Constant Propagation on function (Z8align_upImiET_S0_T0)
BISECT: running pass (5127) Bit-Tracking Dead Code Elimination on function (Z8align_upImiET_S0_T0)
BISECT: running pass (5128) Combine redundant instructions on function (Z8align_upImiET_S0_T0)
BISECT: running pass (5129) Jump Threading on function (Z8align_upImiET_S0_T0)
BISECT: running pass (5130) Value Propagation on function (Z8align_upImiET_S0_T0)
BISECT: running pass (5131) Dead Store Elimination on function (Z8align_upImiET_S0_T0)
BISECT: running pass (5132) Aggressive Dead Code Elimination on function (Z8align_upImiET_S0_T0)
BISECT: running pass (5133) Simplify the CFG on function (Z8align_upImiET_S0_T0)
BISECT: running pass (5134) Combine redundant instructions on function (Z8align_upImiET_S0_T0)
BISECT: running pass (5135) Remove unused exception handling info on SCC (Z8align_upIhiEPT_S1_T0)
BISECT: running pass (5136) Function Integration/Inlining on SCC (Z8align_upIhiEPT_S1_T0)
BISECT: running pass (5137) Deduce function attributes on SCC (Z8align_upIhiEPT_S1_T0)
BISECT: running pass (5138) SROA on function (Z8align_upIhiEPT_S1_T0)
BISECT: running pass (5139) Early CSE w/ MemorySSA on function (Z8align_upIhiEPT_S1_T0)
BISECT: running pass (5140) Speculatively execute instructions if target has divergent branches on function (Z8align_upIhiEPT_S1_T0)
BISECT: running pass (5141) Jump Threading on function (Z8align_upIhiEPT_S1_T0)
BISECT: running pass (5142) Value Propagation on function (Z8align_upIhiEPT_S1_T0)
BISECT: running pass (5143) Simplify the CFG on function (Z8align_upIhiEPT_S1_T0)
BISECT: running pass (5144) Combine redundant instructions on function (Z8align_upIhiEPT_S1_T0)
BISECT: running pass (5145) Tail Call Elimination on function (Z8align_upIhiEPT_S1_T0)
BISECT: running pass (5146) Simplify the CFG on function (Z8align_upIhiEPT_S1_T0)
BISECT: running pass (5147) Reassociate expressions on function (Z8align_upIhiEPT_S1_T0)
BISECT: running pass (5148) Simplify the CFG on function (Z8align_upIhiEPT_S1_T0)
BISECT: running pass (5149) Combine redundant instructions on function (Z8align_upIhiEPT_S1_T0)
BISECT: running pass (5150) MergedLoadStoreMotion on function (Z8align_upIhiEPT_S1_T0)
BISECT: running pass (5151) Global Value Numbering on function (Z8align_upIhiEPT_S1_T0)
BISECT: running pass (5152) MemCpy Optimization on function (Z8align_upIhiEPT_S1_T0)
BISECT: running pass (5153) Sparse Conditional Constant Propagation on function (Z8align_upIhiEPT_S1_T0)
BISECT: running pass (5154) Bit-Tracking Dead Code Elimination on function (Z8align_upIhiEPT_S1_T0)
BISECT: running pass (5155) Combine redundant instructions on function (Z8align_upIhiEPT_S1_T0)
BISECT: running pass (5156) Jump Threading on function (Z8align_upIhiEPT_S1_T0)
BISECT: running pass (5157) Value Propagation on function (Z8align_upIhiEPT_S1_T0)
BISECT: running pass (5158) Dead Store Elimination on function (Z8align_upIhiEPT_S1_T0)
BISECT: running pass (5159) Aggressive Dead Code Elimination on function (Z8align_upIhiEPT_S1_T0)
BISECT: running pass (5160) Simplify the CFG on function (Z8align_upIhiEPT_S1_T0)
BISECT: running pass (5161) Combine redundant instructions on function (Z8align_upIhiEPT_S1_T0)
BISECT: running pass (5162) Remove unused exception handling info on SCC (_ZL19test_arraycopy_funcPhi)
BISECT: running pass (5163) Function Integration/Inlining on SCC (_ZL19test_arraycopy_funcPhi)
BISECT: running pass (5164) Deduce function attributes on SCC (_ZL19test_arraycopy_funcPhi)
BISECT: running pass (5165) SROA on function (_ZL19test_arraycopy_funcPhi)
BISECT: running pass (5166) Early CSE w/ MemorySSA on function (_ZL19test_arraycopy_funcPhi)
BISECT: running pass (5167) Speculatively execute instructions if target has divergent branches on function (_ZL19test_arraycopy_funcPhi)
BISECT: running pass (5168) Jump Threading on function (_ZL19test_arraycopy_funcPhi)
BISECT: running pass (5169) Value Propagation on function (_ZL19test_arraycopy_funcPhi)
BISECT: running pass (5170) Simplify the CFG on function (_ZL19test_arraycopy_funcPhi)
BISECT: NOT running pass (5171) Combine redundant instructions on function (_ZL19test_arraycopy_funcPhi)