Commit 253af83f authored by Jö Fahlke's avatar Jö Fahlke

[!119] Narrow compiler/options for skipping testcornerstoragerefwrap

Merge branch 'narrow-testskip-to-bad-config' into 'master'

ref:core/dune-geometry We now only skip if

-   The compiler is gcc 8.2.\*
-   The compile options include -ftree-loop-vectorize (possibly implicitly due
    to -O3)

We also complain loudly during cmake configure run, as this issue might
miscompile other code than just the test.

Closes: [#19], [#21]

See merge request [!119]

  [#19]: gitlab.dune-project.org/NoneNone/issues/19
  [#21]: gitlab.dune-project.org/NoneNone/issues/21
  [!119]: gitlab.dune-project.org/core/dune-geometry/merge_requests/119


Closes #19 and #21
parents 92165eda 0d09c4b0
Pipeline #15364 passed with stage
in 2 minutes and 51 seconds
......@@ -8,10 +8,50 @@ dune_add_test(SOURCES test-axisalignedcubegeometry.cc
# https://gitlab.dune-project.org/core/dune-geometry/issues/19,
# a.k.a. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87288
set(ISSUE19_UNAFFECTED_GXX ON)
set(issue19_affected_configs)
function(check_compiler_issue19 config)
string(TOUPPER "${config}" CONFIG)
separate_arguments(opts UNIX_COMMAND "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${CONFIG}}")
execute_process(
COMMAND ${CMAKE_CXX_COMPILER} ${opts} -Q --help=optimizers
OUTPUT_VARIABLE opt_settings
ERROR_VARIABLE ignored # silence cc1 complaint about c++ options...
)
if(opt_settings MATCHES "-ftree-loop-vectorize[ \t]+\\[enabled\\]")
set(ISSUE19_UNAFFECTED_GXX OFF PARENT_SCOPE)
list(APPEND issue19_affected_configs "${config}")
set(issue19_affected_configs "${issue19_affected_configs}" PARENT_SCOPE)
endif()
endfunction(check_compiler_issue19)
if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND
(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 8.2) AND
(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9))
set(ISSUE19_UNAFFECTED_GXX OFF)
(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 8.3))
if(CMAKE_BUILD_TYPE)
check_compiler_issue19("${CMAKE_BUILD_TYPE}")
elseif(CMAKE_CONFIGURATION_TYPES)
# multi-configuration generator, check each configuration and if any is
# bad skip test for all of them. dune_add_test does not really allow to
# make the guard configuration-dependent.
foreach(conf IN LISTS CMAKE_CONFIGURATION_TYPES)
check_compiler_issue19("${conf}")
endforeach(conf)
else()
check_compiler_issue19("")
endif()
if(NOT ISSUE19_UNAFFECTED_GXX)
if(issue19_affected_configs)
string(REPLACE ";" ", " issue19_affected_configs "${issue19_affected_configs}")
set(issue19_affected_configs
" (Affected configurations: ${issue19_affected_configs})")
endif()
message(WARNING "You are using gcc 8.2 with optimization options "
"including -ftree-loop-vectorize (possibly implicated by -O3). This is "
"known to miscompile, see "
"https://gitlab.dune-project.org/core/dune-geometry/issues/19 and "
"https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87288${issue19_affected_configs}")
message(WARNING "Skipping test-cornerstoragerefwrap due to known-bad "
"compiler/optimization combination")
endif()
endif()
dune_add_test(SOURCES test-cornerstoragerefwrap.cc
LINK_LIBRARIES dunegeometry
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment