#include "trans-const.h"
#include "arith.h"
-int has_alternate_specifier;
-
typedef struct iter_info
{
tree var;
gfc_trans_call (gfc_code * code)
{
gfc_se se;
+ int has_alternate_specifier;
/* A CALL starts a new block because the actual arguments may have to
be evaluated first. */
gfc_start_block (&se.pre);
gcc_assert (code->resolved_sym);
- has_alternate_specifier = 0;
/* Translate the call. */
- gfc_conv_function_call (&se, code->resolved_sym, code->ext.actual);
+ has_alternate_specifier
+ = gfc_conv_function_call (&se, code->resolved_sym, code->ext.actual);
/* A subroutine without side-effect, by definition, does nothing! */
TREE_SIDE_EFFECTS (se.expr) = 1;
tmp = build2 (PLUS_EXPR, TREE_TYPE (var), var, step);
gfc_add_modify_expr (&block, var, tmp);
- /* Advance to the next mask element. */
- if (mask_flag)
+ /* Advance to the next mask element. Only do this for the
+ innermost loop. */
+ if (n == 0 && mask_flag)
{
mask = forall_tmp->mask;
maskindex = forall_tmp->maskindex;