gcc_assert (reduction_dimensions == ploop->dimen);
- if (nonempty == NULL && maskss == NULL)
+ if (nonempty == NULL && !(maskexpr && maskexpr->rank > 0))
{
nonempty = logical_true_node;
gfc_start_scalarized_body (ploop, &body);
/* If we have a mask, only check this element if the mask is set. */
- if (maskss)
+ if (maskexpr && maskexpr->rank > 0)
{
gcc_assert (!nested_loop);
gfc_init_se (&maskse, NULL);
}
gfc_add_expr_to_block (&block, ifbody);
- if (maskss)
+ if (maskexpr && maskexpr->rank > 0)
{
/* We enclose the above in if (mask) {...}. If the mask is an
optional argument, generate IF (.NOT. PRESENT(MASK)
gfc_add_expr_to_block (outer_block, build1_v (LABEL_EXPR, lab1));
/* If we have a mask, only check this element if the mask is set. */
- if (maskss)
+ if (maskexpr && maskexpr->rank > 0)
{
gfc_init_se (&maskse, NULL);
gfc_copy_loopinfo_to_se (&maskse, &loop);
gfc_add_expr_to_block (&block, tmp);
- if (maskss)
+ if (maskexpr && maskexpr->rank > 0)
{
/* We enclose the above in if (mask) {...}. If the mask is
an optional argument, generate IF (.NOT. PRESENT(MASK)
gfc_add_expr_to_block (&loop.pre, build1_v (LABEL_EXPR, lab2));
/* For a scalar mask, enclose the loop in an if statement. */
- if (maskexpr && maskss == NULL)
+ if (maskexpr && maskexpr->rank == 0)
{
tree ifmask;