Skip to content

Commit 395115e

Browse files
authored
[SPEC] Workaround error with latest clang in 523.xalancbmk_r (#236)
523.xalancbmk_r has some code that calculates the offset of a member, but is undefined behaviour. After llvm/llvm-project#130742 this is now optimized away which results in a miscompile. This has been fixed in upstream versions of xerces-c, but not yet in SPEC CPU 2017: apache/xerces-c@02e4849#diff-e2f4677367dcf43bd6d31b2bbca5b1aa89e36ec155a040fe4447b201a554cf81 This patch passes -fwrapv-pointer to 523.xalancbmk_r to work around it for now. Ideally SPEC CPU 2017 will issue an update which fixes this issue and we can drop this flag. I've included it in the 2006 benchmark too for good measure, although I haven't tried it out, see 92b58b3
1 parent dbfbae8 commit 395115e

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

External/SPEC/CINT2006/483.xalancbmk/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ add_definitions(
1414

1515
list(APPEND CXXFLAGS -std=gnu++98)
1616

17+
# Workaround undefined behaviour in xerces-c dependency.
18+
# This is fixed upstream but not included in SPEC CPU 2017:
19+
# https://github.com/apache/xerces-c/commit/02e48494496dd24476490fd36c1bc97b6a37002e#diff-e2f4677367dcf43bd6d31b2bbca5b1aa89e36ec155a040fe4447b201a554cf81
20+
add_compile_options(-fwrapv-pointer)
21+
1722
include(CheckCXXCompilerFlag)
1823
check_cxx_compiler_flag(-fdelayed-template-parsing
1924
HAVE_CXX_FLAG_FDELAYED_TEMPLATE_PARSING)

External/SPEC/CINT2017rate/523.xalancbmk_r/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ speccpu2017_benchmark(RATE)
88

99
set(CMAKE_CXX_STANDARD 14)
1010

11+
# Workaround undefined behaviour in xerces-c dependency.
12+
# This is fixed upstream but not included in SPEC CPU 2017:
13+
# https://github.com/apache/xerces-c/commit/02e48494496dd24476490fd36c1bc97b6a37002e#diff-e2f4677367dcf43bd6d31b2bbca5b1aa89e36ec155a040fe4447b201a554cf81
14+
add_compile_options(-fwrapv-pointer)
15+
1116
include(CheckCXXCompilerFlag)
1217
check_cxx_compiler_flag(-fdelayed-template-parsing
1318
HAVE_CXX_FLAG_FDELAYED_TEMPLATE_PARSING)

0 commit comments

Comments
 (0)