[ET Trac] #2818: failing tests with gcc-14

Roland Haas trac-noreply at einsteintoolkit.org
Sun Nov 3 11:31:03 CST 2024


#2818: failing tests with gcc-14

 Reporter: Roland Haas
   Status: new
Milestone: 
  Version: 
     Type: bug
 Priority: major
Component: EinsteinToolkit thorn

Comment (by Roland Haas):

The issue seems to be related to `loop.hxx` and its code:  

```c++
 190             const PointDesc p =
 191                 point_desc({CI, CJ, CK}, I, iter, NI, I0, BI, bnd_min, bnd_max,
 192                            loop_min, loop_max);
```

where the first arguments gets passed as `vect<bool, dim>&`. Changing to code to have an explicit variable:  

```
const vect<bool, dim> _CI{CI,CJ,CK};
```

and passing that one for the first argument makes the tests pass.  
  
Without the explicit variable gcc-14 emits a warning:  

```text
In lambda function,
    inlined from ?constexpr std::array<_Tp, _Nm> Arith::construct_array(const F&) [with T = bool; long unsigned int N = 1; F = vect<bool, 3>::vect(std::initializer_list<bool>)::<lambda(size_t)>]? at /data/rhaas/postdoc/gr/cactus/ET_trunk
/arrangements/CarpetX/Arith/src/vect.hxx:94:57,
    inlined from ?constexpr std::array<_Tp, _Nm> Arith::construct_array(const F&) [with T = bool; long unsigned int N = 2; F = vect<bool, 3>::vect(std::initializer_list<bool>)::<lambda(size_t)>]? at /data/rhaas/postdoc/gr/cactus/ET_trunk
/arrangements/CarpetX/Arith/src/vect.hxx:94:51,
    inlined from ?constexpr std::array<_Tp, _Nm> Arith::construct_array(const F&) [with T = bool; long unsigned int N = 3; F = vect<bool, 3>::vect(std::initializer_list<bool>)::<lambda(size_t)>]? at /data/rhaas/postdoc/gr/cactus/ET_trunk
/arrangements/CarpetX/Arith/src/vect.hxx:94:51,
    inlined from ?constexpr Arith::vect<T, D>::vect(std::initializer_list<_Tp>) [with T = bool; int D = 3]? at /data/rhaas/postdoc/gr/cactus/ET_trunk/arrangements/CarpetX/Arith/src/vect.hxx:139:35,
    inlined from ?void Loop::GridDescBase::loop_box(const Arith::vect<int, 3>&, const Arith::vect<int, 3>&, const Arith::vect<int, 3>&, const Arith::vect<int, 3>&, const F&) const [with int CI = 1; int CJ = 1; int CK = 1; int VS = 1; int
 N = 1; F = TestProlongate::TestProlongate_Regrid(cGH*)::<lambda(const Loop::PointDesc&)>]? at /data/rhaas/postdoc/gr/cactus/ET_trunk/arrangements/CarpetX/Loop/src/loop.hxx:191:27,
    inlined from ?void Loop::GridDescBase::loop_int(const Arith::vect<int, 3>&, const F&) const [with int CI = 1; int CJ = 1; int CK = 1; int VS = 1; int N = 1; F = TestProlongate::TestProlongate_Regrid(cGH*)::<lambda(const Loop::PointDe
sc&)>]? at /data/rhaas/postdoc/gr/cactus/ET_trunk/arrangements/CarpetX/Loop/src/loop.hxx:276:32,
    inlined from ?std::enable_if_t<(where == Loop::where_t::interior), void> Loop::GridDescBase::loop(const Arith::vect<int, 3>&, const F&) const [with int CI = 1; int CJ = 1; int CK = 1; Loop::where_t where = Loop::where_t::interior; F
= TestProlongate::TestProlongate_Regrid(cGH*)::<lambda(const Loop::PointDesc&)>]? at /data/rhaas/postdoc/gr/cactus/ET_trunk/arrangements/CarpetX/Loop/src/loop.hxx:650:25,
    inlined from ?void Loop::GridDescBase::loop(const F&) const [with int CI = 1; int CJ = 1; int CK = 1; Loop::where_t where = Loop::where_t::interior; F = TestProlongate::TestProlongate_Regrid(cGH*)::<lambda(const Loop::PointDesc&)>]?
at /data/rhaas/postdoc/gr/cactus/ET_trunk/arrangements/CarpetX/Loop/src/loop.hxx:711:28,
    inlined from ?void Loop::loop(const cGH*, const F&) [with int CI = 1; int CJ = 1; int CK = 1; where_t where = Loop::where_t::interior; F = TestProlongate::TestProlongate_Regrid(cGH*)::<lambda(const PointDesc&)>]? at /data/rhaas/postdoc/gr/cactus/ET_trunk/arrangements/CarpetX/Loop/src/loop.hxx:770:47,
    inlined from ?void Loop::loop_int(const cGH*, const F&) [with int CI = 1; int CJ = 1; int CK = 1; F = TestProlongate::TestProlongate_Regrid(cGH*)::<lambda(const PointDesc&)>]? at /data/rhaas/postdoc/gr/cactus/ET_trunk/arrangements/CarpetX/Loop/src/loop.hxx:786:38,
    inlined from ?void TestProlongate::TestProlongate_Regrid(cGH*)? at /data/rhaas/postdoc/gr/cactus/ET_trunk/configs/tests/build/TestProlongate/test.cxx:236:26:
/data/rhaas/postdoc/gr/cactus/ET_trunk/arrangements/CarpetX/Arith/src/vect.hxx:143:31: warning: ?<anonymous>? may be used uninitialized [-Wmaybe-uninitialized]
  143 |           return lst.begin()[d];
      |                               ^
/data/rhaas/postdoc/gr/cactus/ET_trunk/arrangements/CarpetX/Loop/src/loop.hxx: In function ?void TestProlongate::TestProlongate_Regrid(cGH*)?:
/data/rhaas/postdoc/gr/cactus/ET_trunk/arrangements/CarpetX/Loop/src/loop.hxx:177:9: note: ?<anonymous>? declared here
  177 | #pragma omp simd
      |         ^~~
```

So this change:

```diff
diff --git a/Loop/src/loop.hxx b/Loop/src/loop.hxx
index 0aaa290c..0cb82580 100644
--- a/Loop/src/loop.hxx
+++ b/Loop/src/loop.hxx
@@ -187,8 +187,9 @@ public:
             // Outward boundary normal (if on outermost interior point), else 0
             const vect<int, dim> BI =
                 vect<int, dim>(I == bnd_max - 1) - vect<int, dim>(I == bnd_min);
+            const vect<bool, dim> _CI{CI, CJ, CK};
             const PointDesc p =
-                point_desc({CI, CJ, CK}, I, iter, NI, I0, BI, bnd_min, bnd_max,
+                point_desc(_CI, I, iter, NI, I0, BI, bnd_min, bnd_max,
                            loop_min, loop_max);
             f(p);
           }
```

makes the tests pass, though I am not quite sure why.

--
Ticket URL: https://bitbucket.org/einsteintoolkit/tickets/issues/2818/failing-tests-with-gcc-14
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.einsteintoolkit.org/pipermail/trac/attachments/20241103/4355792f/attachment.htm>


More information about the Trac mailing list