https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82976
--- Comment #8 from Thomas Koenig <tkoenig at gcc dot gnu.org> ---
What I meant was this part of resolve_mask_arg :
/* In the library, we access the mask with a GFC_LOGICAL_1
argument. No need to waste memory if we are about to create
a temporary array. */
if (mask->expr_type == EXPR_OP && mask->ts.kind != 1)
{
ts.type = BT_LOGICAL;
ts.kind = 1;
gfc_convert_type_warn (mask, &ts, 2, 0);
