LACINL bug
When compiling the following code with sac2c -maxwlur 27 -DBUG
we end up with a weird SEGFAULT on an AVIS_DIM... in phase opt:esdcf:cyc:1
.
My compiler is
-sbs-n142244-> sac2c -V
sac2c 1.3.3-MijasCosta-1061-ga5c8d
build-type: RELEASE
built-by: "sbs" at 2023-08-09T17:38:39
// compile with -maxwlur 27 -DBUG
// it is a lacinlining problem triggered in opt:esdcf:cyc:1
inline
double plus( double a, double b) { return _add_SxS_(a, b);}
double[2,2,2] relax (double[2,2,2] x)
{
#ifdef BUG
return with {
([0,0,0] <= ov < [2,2,2]) : with {
([0,0,0] <= jv < [3,3,3]) : _sel_VxA_ (ov, with {
([0,0,0]<= iv < [3,3,3]) : _sel_VxA_(_aplmod_VxV_ (_sub_VxV_ (iv,jv), _shape_A_(x)), x);
} : modarray(x));
} : fold (plus, 0d);
} : genarray( [2,2,2], 0d);
#else
return with {
([0,0,0] <= ov < [2,2,2]) : with {
([0,0,0] <= jv < [3,3,3]) : _sel_VxA_ (ov, with {
([0,0,0]<= iv < [3,3,3]) : _sel_VxA_(_aplmod_VxV_ (_sub_VxV_ (iv,jv), _shape_A_(x)), x);
} : modarray(x));
} : fold (plus, 0d);
} : modarray (x);
#endif
}
int main()
{
v = with {} : genarray ([2,2,2], 0d);
rv = relax (v);
r = with {
([0,0,0] <= iv < [2,2,2]) : _sel_VxA_(iv, rv);
} : fold( plus, 0d);
return _toi_S_ (r);
}