FP exception in test with clang 10
Hi,
I'm having trouble with clang-10. The extended HytegVsFenicsFormTest fails in the pipeline. The problem is that, at least to me, this seems that this error is introduced by this specific clang version in the optimisation. The problem does neither occur in Debug mode nor with GCC.
I can reproduce the problem using
- cmake 10.0
- CMAKE_BUILD_TYPE = RelWithDebInfo
- SHA 52ebc999
Running the executable through gdb I get
Thread 1 "HytegVsFenicsFo" received signal SIGFPE, Arithmetic exception.
hyteg::P2Form_epsilon_11::evalQuadraturePoint2D (this=0x7fffffffd940, x_hat=..., x_tilde=..., coords=..., DF=...,
w=0.16666666666666666, elMat=...)
at .../HyTeG/src/hyteg/forms/form_hyteg_generated/P2FormEpsilon.hpp:43
43 real_t tmp11 = 1/(std::pow(tmp10, 2)*std::pow(tmp9, 2));
This makes sense as in the pipeline a division-by-zero was reported. However, when I look at the input arguments I get
(gdb) info args
this = 0x7fffffffd940
x_hat = @0x7fffffffd680: {x_ = {0, 0.5, 0}}
x_tilde = @0x7fffffffd6a0: {x_ = {-0.84999999999999998, -0.75, 0}}
coords = @0x7fffffffddd0: {_M_elems = {{x_ = {-0.69999999999999996, -2, 0}}, {x_ = {1, 1, 0}}, {x_ = {-1, 0.5, 0}}}}
DF = @0x7fffffffd6c0: {static Size = 4, x = {1, 0, 0, 1}}
w = 0.16666666666666666
elMat = @0x7fffffffdc40: {static Size = 36, x = {0.14563106796116504, 0.061488673139158581, 0.20711974110032361, -0.41423948220064721,
-0.41423948220064721, 0.41423948220064721, 0.061488673139158581, 0.40744336569579287, 0.46893203883495144, -0.93786407766990287,
-0.93786407766990287, 0.93786407766990287, 0.20711974110032361, 0.46893203883495144, 0.6760517799352751, -1.35210355987055,
-1.35210355987055, 1.35210355987055, -0.41423948220064721, -0.93786407766990287, -1.35210355987055, 2.7042071197411004,
2.7042071197411, -2.7042071197411, -0.41423948220064721, -0.93786407766990287, -1.35210355987055, 2.7042071197411,
2.7042071197411004, -2.7042071197411, 0.41423948220064721, 0.93786407766990287, 1.35210355987055, -2.7042071197411,
-2.7042071197411, 2.7042071197411004}}
from which I can check that neither tmp9 nor tmp10 should have zero value. Trying to check their values I get
tmp9 = <optimized out>
tmp10 = <optimized out>
which leads me to assume that the problem is optimisation related.
As I cannot reproduce the problem with clang-8 I assume it might be related to clang-10 only.
Suggestions anyone?
Cheers
Marcus