WLSTRIDE_ISMODIFIED error
when compiling
noinline
double[4,4,4] coarse2fine (double[2,2,2] z)
{
foo = with {
([1, 1, 1] <= iv < [4,4,4] step [2, 2, 2] ) : _sel_VxA_(_div_VxS_(_sub_VxS_(iv, 1), 2),z);
} : genarray ([4,4,4], 0d);
return foo;
}
noinline
double[2,2,2] fine2coarse(double[4,4,4] r)
{
bar = with {
([0,0,0] <= iv < [2,2,2]) : _sel_VxA_(_mul_SxV_(2,iv),r);
} : genarray ([2,2,2], 0d);
return bar;
}
int main()
{
u = with {} : genarray([4,4,4], 0d);
rs = fine2coarse (u);
u = coarse2fine (rs);
return _toi_S_(_sel_VxA_([0,0,0], u));
}
with
-sbs-SvenBodosAir2-> sac2c-d -V
sac2c 1.3.3-MijasCosta-1079-g648dba
build-type: DEBUG
built-by: "sbs" at 2023-09-13T11:13:47
I get
-sbs-Sven-Bodos-MacBook-Air-2-> sac2c-d bug.sac
** 1: Loading SAC program ...
** 2: Preprocessing SAC program ...
** 3: Running module system ...
** 4: Simplifying source code ...
** 5: Converting to static single assignment form ...
** 6: Running type inference system ...
** 7: Processing exports ...
** 8: Preparing for code optimization ...
** 9: Enhancing with-loops ...
** 10: Running SAC optimizations ...
** 11: Automatic parallelisation for GPUs skipped.
** 12: Transforming with-loop representation ...
Internal compiler error
Assertion "!WLSTRIDE_ISMODIFIED (stride1)" failed at /Volumes/Users/sbs/sac2c/src/libsac2c/wltransform/wltransform.c:3654 -- stride was modified
Please file a bug at: https://gitlab.sac-home.org/sac-group/sac2c/-/issues