https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97896
Mikael Morin <mikael at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mikael at gcc dot gnu.org --- Comment #4 from Mikael Morin <mikael at gcc dot gnu.org> --- (In reply to anlauf from comment #3) > so something is screwing up the scalarization. Indeed. gfc_walk_expr registers all the arrays involved as an early step of scalarizing a statement. The failing assert checks that all the arrays have been used/consumed, meaning that the array registration and the actual code generation are kept synchronized. Elemental actual arguments are some of those arrays involved. Obviously one should not remove some of them in the middle of code generation. It should be done beforehand if at all.