MTSTF fails if dead functions with potentially concurrent WLs are left in the AST.
A minimal example is:
noinline
int[.] inc (int[.] a)
{
return with {
(. <= iv <= .) : _add_SxS_ (1, _sel_VxA_(iv, a));
} : genarray (_shape_A_(a), 1);
}
int main()
{
return 0;
}
when compiled with -tmt_pth -noDFR
with sac2c 1.3.3-MijasCosta-1244-g5a3e8
we get
** 21: Generating Code ...
Internal compiler error
Assertion "((NODE_TYPE (COND_COND (arg_node)) == N_id) || (NODE_TYPE (COND_COND (arg_node)) == N_bool))" failed at /Volumes/Users/sbs/sac2c/src/libsac2c/codegen/compile.c:10178 -- if-clause condition is neither a N_id nor a N_bool but node type 51!
The erroneous node is an application of F_run_mt_genarray which should have been eliminated in mt:mtstf!