From: Thomas Koenig Date: Mon, 31 Dec 2018 14:59:46 +0000 (+0000) Subject: re PR fortran/82995 (Segmentation fault passing optional argument to intrinsic sum... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2ea47ee9fd022b611cf238f0b58aafd8472b6913;p=gcc.git re PR fortran/82995 (Segmentation fault passing optional argument to intrinsic sum function) 2018-12-31 Thomas Koenig PR fortran/82995 * trans-expr.c (gfc_conv_procedure_call): Pass NULL pointer for missing optional dummy arguments for library routines. * trans-intinsic.c (conv_mask_condition): New function. (gfc_conv_intrinsic_arith): Detect and handle optional mask. (gfc_conv_intrinsic_minmaxloc): Likewise. (gfc_conv_intrinsic_findloc): Likewise. (gfc_conv_intrinsic_minmaxval): Likewise. (gfc_inline_intrinsic_function_p): Do not inline for rank > 1 if an optional mask is present. 2018-12-31 Thomas Koenig PR fortran/82995 * m4/ifindloc0.m4: Handle case of absend optional argument, passed as a NULL pointer. Correct allocation of retarray->base_addr. * m4/ifindloc1.m4: Likewise. * m4/ifindloc2.m4: Handle case of absend optional argument, passed as a NULL pointer. * m4/iforeach-s.m4: Likewise. * m4/iforeach-s2.m4: Likewise. * m4/iforeach.m4: Likewise. * m4/ifunction-s.m4: Likewise. * m4/ifunction-s2.m4: Likewise. * m4/ifunction.m4: Likewise. * generated/findloc0_c16.c: Regenerated. * generated/findloc0_c4.c: Regenerated. * generated/findloc0_c8.c: Regenerated. * generated/findloc0_i1.c: Regenerated. * generated/findloc0_i16.c: Regenerated. * generated/findloc0_i2.c: Regenerated. * generated/findloc0_i4.c: Regenerated. * generated/findloc0_i8.c: Regenerated. * generated/findloc0_r16.c: Regenerated. * generated/findloc0_r4.c: Regenerated. * generated/findloc0_r8.c: Regenerated. * generated/findloc0_s1.c: Regenerated. * generated/findloc0_s4.c: Regenerated. * generated/findloc1_c16.c: Regenerated. * generated/findloc1_c4.c: Regenerated. * generated/findloc1_c8.c: Regenerated. * generated/findloc1_i1.c: Regenerated. * generated/findloc1_i16.c: Regenerated. * generated/findloc1_i2.c: Regenerated. * generated/findloc1_i4.c: Regenerated. * generated/findloc1_i8.c: Regenerated. * generated/findloc1_r16.c: Regenerated. * generated/findloc1_r4.c: Regenerated. * generated/findloc1_r8.c: Regenerated. * generated/findloc1_s1.c: Regenerated. * generated/findloc1_s4.c: Regenerated. * generated/findloc2_s1.c: Regenerated. * generated/findloc2_s4.c: Regenerated. * generated/iall_i1.c: Regenerated. * generated/iall_i16.c: Regenerated. * generated/iall_i2.c: Regenerated. * generated/iall_i4.c: Regenerated. * generated/iall_i8.c: Regenerated. * generated/iany_i1.c: Regenerated. * generated/iany_i16.c: Regenerated. * generated/iany_i2.c: Regenerated. * generated/iany_i4.c: Regenerated. * generated/iany_i8.c: Regenerated. * generated/iparity_i1.c: Regenerated. * generated/iparity_i16.c: Regenerated. * generated/iparity_i2.c: Regenerated. * generated/iparity_i4.c: Regenerated. * generated/iparity_i8.c: Regenerated. * generated/maxloc0_16_i1.c: Regenerated. * generated/maxloc0_16_i16.c: Regenerated. * generated/maxloc0_16_i2.c: Regenerated. * generated/maxloc0_16_i4.c: Regenerated. * generated/maxloc0_16_i8.c: Regenerated. * generated/maxloc0_16_r10.c: Regenerated. * generated/maxloc0_16_r16.c: Regenerated. * generated/maxloc0_16_r4.c: Regenerated. * generated/maxloc0_16_r8.c: Regenerated. * generated/maxloc0_16_s1.c: Regenerated. * generated/maxloc0_16_s4.c: Regenerated. * generated/maxloc0_4_i1.c: Regenerated. * generated/maxloc0_4_i16.c: Regenerated. * generated/maxloc0_4_i2.c: Regenerated. * generated/maxloc0_4_i4.c: Regenerated. * generated/maxloc0_4_i8.c: Regenerated. * generated/maxloc0_4_r10.c: Regenerated. * generated/maxloc0_4_r16.c: Regenerated. * generated/maxloc0_4_r4.c: Regenerated. * generated/maxloc0_4_r8.c: Regenerated. * generated/maxloc0_4_s1.c: Regenerated. * generated/maxloc0_4_s4.c: Regenerated. * generated/maxloc0_8_i1.c: Regenerated. * generated/maxloc0_8_i16.c: Regenerated. * generated/maxloc0_8_i2.c: Regenerated. * generated/maxloc0_8_i4.c: Regenerated. * generated/maxloc0_8_i8.c: Regenerated. * generated/maxloc0_8_r10.c: Regenerated. * generated/maxloc0_8_r16.c: Regenerated. * generated/maxloc0_8_r4.c: Regenerated. * generated/maxloc0_8_r8.c: Regenerated. * generated/maxloc0_8_s1.c: Regenerated. * generated/maxloc0_8_s4.c: Regenerated. * generated/maxloc1_16_i1.c: Regenerated. * generated/maxloc1_16_i16.c: Regenerated. * generated/maxloc1_16_i2.c: Regenerated. * generated/maxloc1_16_i4.c: Regenerated. * generated/maxloc1_16_i8.c: Regenerated. * generated/maxloc1_16_r10.c: Regenerated. * generated/maxloc1_16_r16.c: Regenerated. * generated/maxloc1_16_r4.c: Regenerated. * generated/maxloc1_16_r8.c: Regenerated. * generated/maxloc1_16_s1.c: Regenerated. * generated/maxloc1_16_s4.c: Regenerated. * generated/maxloc1_4_i1.c: Regenerated. * generated/maxloc1_4_i16.c: Regenerated. * generated/maxloc1_4_i2.c: Regenerated. * generated/maxloc1_4_i4.c: Regenerated. * generated/maxloc1_4_i8.c: Regenerated. * generated/maxloc1_4_r10.c: Regenerated. * generated/maxloc1_4_r16.c: Regenerated. * generated/maxloc1_4_r4.c: Regenerated. * generated/maxloc1_4_r8.c: Regenerated. * generated/maxloc1_4_s1.c: Regenerated. * generated/maxloc1_4_s4.c: Regenerated. * generated/maxloc1_8_i1.c: Regenerated. * generated/maxloc1_8_i16.c: Regenerated. * generated/maxloc1_8_i2.c: Regenerated. * generated/maxloc1_8_i4.c: Regenerated. * generated/maxloc1_8_i8.c: Regenerated. * generated/maxloc1_8_r10.c: Regenerated. * generated/maxloc1_8_r16.c: Regenerated. * generated/maxloc1_8_r4.c: Regenerated. * generated/maxloc1_8_r8.c: Regenerated. * generated/maxloc1_8_s1.c: Regenerated. * generated/maxloc1_8_s4.c: Regenerated. * generated/maxval0_s1.c: Regenerated. * generated/maxval0_s4.c: Regenerated. * generated/maxval1_s1.c: Regenerated. * generated/maxval1_s4.c: Regenerated. * generated/maxval_i1.c: Regenerated. * generated/maxval_i16.c: Regenerated. * generated/maxval_i2.c: Regenerated. * generated/maxval_i4.c: Regenerated. * generated/maxval_i8.c: Regenerated. * generated/maxval_r10.c: Regenerated. * generated/maxval_r16.c: Regenerated. * generated/maxval_r4.c: Regenerated. * generated/maxval_r8.c: Regenerated. * generated/minloc0_16_i1.c: Regenerated. * generated/minloc0_16_i16.c: Regenerated. * generated/minloc0_16_i2.c: Regenerated. * generated/minloc0_16_i4.c: Regenerated. * generated/minloc0_16_i8.c: Regenerated. * generated/minloc0_16_r10.c: Regenerated. * generated/minloc0_16_r16.c: Regenerated. * generated/minloc0_16_r4.c: Regenerated. * generated/minloc0_16_r8.c: Regenerated. * generated/minloc0_16_s1.c: Regenerated. * generated/minloc0_16_s4.c: Regenerated. * generated/minloc0_4_i1.c: Regenerated. * generated/minloc0_4_i16.c: Regenerated. * generated/minloc0_4_i2.c: Regenerated. * generated/minloc0_4_i4.c: Regenerated. * generated/minloc0_4_i8.c: Regenerated. * generated/minloc0_4_r10.c: Regenerated. * generated/minloc0_4_r16.c: Regenerated. * generated/minloc0_4_r4.c: Regenerated. * generated/minloc0_4_r8.c: Regenerated. * generated/minloc0_4_s1.c: Regenerated. * generated/minloc0_4_s4.c: Regenerated. * generated/minloc0_8_i1.c: Regenerated. * generated/minloc0_8_i16.c: Regenerated. * generated/minloc0_8_i2.c: Regenerated. * generated/minloc0_8_i4.c: Regenerated. * generated/minloc0_8_i8.c: Regenerated. * generated/minloc0_8_r10.c: Regenerated. * generated/minloc0_8_r16.c: Regenerated. * generated/minloc0_8_r4.c: Regenerated. * generated/minloc0_8_r8.c: Regenerated. * generated/minloc0_8_s1.c: Regenerated. * generated/minloc0_8_s4.c: Regenerated. * generated/minloc1_16_i1.c: Regenerated. * generated/minloc1_16_i16.c: Regenerated. * generated/minloc1_16_i2.c: Regenerated. * generated/minloc1_16_i4.c: Regenerated. * generated/minloc1_16_i8.c: Regenerated. * generated/minloc1_16_r10.c: Regenerated. * generated/minloc1_16_r16.c: Regenerated. * generated/minloc1_16_r4.c: Regenerated. * generated/minloc1_16_r8.c: Regenerated. * generated/minloc1_16_s1.c: Regenerated. * generated/minloc1_16_s4.c: Regenerated. * generated/minloc1_4_i1.c: Regenerated. * generated/minloc1_4_i16.c: Regenerated. * generated/minloc1_4_i2.c: Regenerated. * generated/minloc1_4_i4.c: Regenerated. * generated/minloc1_4_i8.c: Regenerated. * generated/minloc1_4_r10.c: Regenerated. * generated/minloc1_4_r16.c: Regenerated. * generated/minloc1_4_r4.c: Regenerated. * generated/minloc1_4_r8.c: Regenerated. * generated/minloc1_4_s1.c: Regenerated. * generated/minloc1_4_s4.c: Regenerated. * generated/minloc1_8_i1.c: Regenerated. * generated/minloc1_8_i16.c: Regenerated. * generated/minloc1_8_i2.c: Regenerated. * generated/minloc1_8_i4.c: Regenerated. * generated/minloc1_8_i8.c: Regenerated. * generated/minloc1_8_r10.c: Regenerated. * generated/minloc1_8_r16.c: Regenerated. * generated/minloc1_8_r4.c: Regenerated. * generated/minloc1_8_r8.c: Regenerated. * generated/minloc1_8_s1.c: Regenerated. * generated/minloc1_8_s4.c: Regenerated. * generated/minval0_s1.c: Regenerated. * generated/minval0_s4.c: Regenerated. * generated/minval1_s1.c: Regenerated. * generated/minval1_s4.c: Regenerated. * generated/minval_i1.c: Regenerated. * generated/minval_i16.c: Regenerated. * generated/minval_i2.c: Regenerated. * generated/minval_i4.c: Regenerated. * generated/minval_i8.c: Regenerated. * generated/minval_r10.c: Regenerated. * generated/minval_r16.c: Regenerated. * generated/minval_r4.c: Regenerated. * generated/minval_r8.c: Regenerated. * generated/product_c10.c: Regenerated. * generated/product_c16.c: Regenerated. * generated/product_c4.c: Regenerated. * generated/product_c8.c: Regenerated. * generated/product_i1.c: Regenerated. * generated/product_i16.c: Regenerated. * generated/product_i2.c: Regenerated. * generated/product_i4.c: Regenerated. * generated/product_i8.c: Regenerated. * generated/product_r10.c: Regenerated. * generated/product_r16.c: Regenerated. * generated/product_r4.c: Regenerated. * generated/product_r8.c: Regenerated. * generated/sum_c10.c: Regenerated. * generated/sum_c16.c: Regenerated. * generated/sum_c4.c: Regenerated. * generated/sum_c8.c: Regenerated. * generated/sum_i1.c: Regenerated. * generated/sum_i16.c: Regenerated. * generated/sum_i2.c: Regenerated. * generated/sum_i4.c: Regenerated. * generated/sum_i8.c: Regenerated. * generated/sum_r10.c: Regenerated. * generated/sum_r16.c: Regenerated. * generated/sum_r4.c: Regenerated. * generated/sum_r8.c: Regenerated. 2018-12-31 Thomas Koenig PR fortran/82995 * gfortran.dg/optional_absent_4.f90: New test. * gfortran.dg/optional_absent_5.f90: New test. From-SVN: r267487 --- diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 30a7c0f3b0a..04463651988 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,16 @@ +2018-12-31 Thomas Koenig + + PR fortran/82995 + * trans-expr.c (gfc_conv_procedure_call): Pass NULL pointer + for missing optional dummy arguments for library routines. + * trans-intinsic.c (conv_mask_condition): New function. + (gfc_conv_intrinsic_arith): Detect and handle optional mask. + (gfc_conv_intrinsic_minmaxloc): Likewise. + (gfc_conv_intrinsic_findloc): Likewise. + (gfc_conv_intrinsic_minmaxval): Likewise. + (gfc_inline_intrinsic_function_p): Do not inline for rank > 1 if + an optional mask is present. + 2018-12-29 Steven G. Kargl * expr.c (external_spec_function): Add ieee_support_subnormal to list diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c index a2fd53cc1f3..d0a24fb7c82 100644 --- a/gcc/fortran/trans-expr.c +++ b/gcc/fortran/trans-expr.c @@ -5760,17 +5760,21 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym, array-descriptor actual to array-descriptor dummy, see PR 41911 for why a check has to be inserted. fsym == NULL is checked as intrinsics required the descriptor - but do not always set fsym. */ + but do not always set fsym. + Also, it is necessary to pass a NULL pointer to library routines + which usually ignore optional arguments, so they can handle + these themselves. */ if (e->expr_type == EXPR_VARIABLE && e->symtree->n.sym->attr.optional - && ((e->rank != 0 && elemental_proc) - || e->representation.length || e->ts.type == BT_CHARACTER - || (e->rank != 0 - && (fsym == NULL - || (fsym-> as - && (fsym->as->type == AS_ASSUMED_SHAPE - || fsym->as->type == AS_ASSUMED_RANK - || fsym->as->type == AS_DEFERRED)))))) + && (((e->rank != 0 && elemental_proc) + || e->representation.length || e->ts.type == BT_CHARACTER + || (e->rank != 0 + && (fsym == NULL + || (fsym->as + && (fsym->as->type == AS_ASSUMED_SHAPE + || fsym->as->type == AS_ASSUMED_RANK + || fsym->as->type == AS_DEFERRED))))) + || se->ignore_optional)) gfc_conv_missing_dummy (&parmse, e, fsym ? fsym->ts : e->ts, e->representation.length); } diff --git a/gcc/fortran/trans-intrinsic.c b/gcc/fortran/trans-intrinsic.c index 40a74916bb8..473334efd64 100644 --- a/gcc/fortran/trans-intrinsic.c +++ b/gcc/fortran/trans-intrinsic.c @@ -4359,6 +4359,28 @@ enter_nested_loop (gfc_se *se) return se->ss->loop; } +/* Build the condition for a mask, which may be optional. */ + +static tree +conv_mask_condition (gfc_se *maskse, gfc_expr *maskexpr, + bool optional_mask) +{ + tree present; + tree type; + + if (optional_mask) + { + type = TREE_TYPE (maskse->expr); + present = gfc_conv_expr_present (maskexpr->symtree->n.sym); + present = convert (type, present); + present = fold_build1_loc (input_location, TRUTH_NOT_EXPR, type, + present); + return fold_build2_loc (input_location, TRUTH_ORIF_EXPR, + type, present, maskse->expr); + } + else + return maskse->expr; +} /* Inline implementation of the sum and product intrinsics. */ static void @@ -4380,6 +4402,7 @@ gfc_conv_intrinsic_arith (gfc_se * se, gfc_expr * expr, enum tree_code op, gfc_se *parent_se; gfc_expr *arrayexpr; gfc_expr *maskexpr; + bool optional_mask; if (expr->rank > 0) { @@ -4419,13 +4442,19 @@ gfc_conv_intrinsic_arith (gfc_se * se, gfc_expr * expr, enum tree_code op, arrayexpr = arg_array->expr; if (op == NE_EXPR || norm2) - /* PARITY and NORM2. */ - maskexpr = NULL; + { + /* PARITY and NORM2. */ + maskexpr = NULL; + optional_mask = false; + } else { arg_mask = arg_array->next->next; gcc_assert (arg_mask != NULL); maskexpr = arg_mask->expr; + optional_mask = maskexpr && maskexpr->expr_type == EXPR_VARIABLE + && maskexpr->symtree->n.sym->attr.dummy + && maskexpr->symtree->n.sym->attr.optional; } if (expr->rank == 0) @@ -4444,17 +4473,22 @@ gfc_conv_intrinsic_arith (gfc_se * se, gfc_expr * expr, enum tree_code op, /* Initialize the scalarizer. */ gfc_init_loopinfo (&loop); - gfc_add_ss_to_loop (&loop, arrayss); + + /* We add the mask first because the number of iterations is + taken from the last ss, and this breaks if an absent + optional argument is used for mask. */ + if (maskexpr && maskexpr->rank > 0) gfc_add_ss_to_loop (&loop, maskss); + gfc_add_ss_to_loop (&loop, arrayss); /* Initialize the loop. */ gfc_conv_ss_startstride (&loop); gfc_conv_loop_setup (&loop, &expr->where); - gfc_mark_ss_chain_used (arrayss, 1); if (maskexpr && maskexpr->rank > 0) gfc_mark_ss_chain_used (maskss, 1); + gfc_mark_ss_chain_used (arrayss, 1); ploop = &loop; } @@ -4563,10 +4597,13 @@ gfc_conv_intrinsic_arith (gfc_se * se, gfc_expr * expr, enum tree_code op, if (maskexpr && maskexpr->rank > 0) { - /* We enclose the above in if (mask) {...} . */ - + /* We enclose the above in if (mask) {...} . If the mask is an + optional argument, generate + IF (.NOT. PRESENT(MASK) .OR. MASK(I)). */ + tree ifmask; tmp = gfc_finish_block (&block); - tmp = build3_v (COND_EXPR, maskse.expr, tmp, + ifmask = conv_mask_condition (&maskse, maskexpr, optional_mask); + tmp = build3_v (COND_EXPR, ifmask, tmp, build_empty_stmt (input_location)); } else @@ -4591,10 +4628,13 @@ gfc_conv_intrinsic_arith (gfc_se * se, gfc_expr * expr, enum tree_code op, } else { + tree ifmask; + gcc_assert (expr->rank == 0); gfc_init_se (&maskse, NULL); gfc_conv_expr_val (&maskse, maskexpr); - tmp = build3_v (COND_EXPR, maskse.expr, tmp, + ifmask = conv_mask_condition (&maskse, maskexpr, optional_mask); + tmp = build3_v (COND_EXPR, ifmask, tmp, build_empty_stmt (input_location)); } @@ -4833,6 +4873,7 @@ gfc_conv_intrinsic_minmaxloc (gfc_se * se, gfc_expr * expr, enum tree_code op) gfc_se backse; tree pos; int n; + bool optional_mask; actual = expr->value.function.actual; @@ -4887,6 +4928,9 @@ gfc_conv_intrinsic_minmaxloc (gfc_se * se, gfc_expr * expr, enum tree_code op) actual = actual->next->next; gcc_assert (actual); maskexpr = actual->expr; + optional_mask = maskexpr && maskexpr->expr_type == EXPR_VARIABLE + && maskexpr->symtree->n.sym->attr.dummy + && maskexpr->symtree->n.sym->attr.optional; backexpr = actual->next->next->expr; nonempty = NULL; if (maskexpr && maskexpr->rank != 0) @@ -4939,10 +4983,16 @@ gfc_conv_intrinsic_minmaxloc (gfc_se * se, gfc_expr * expr, enum tree_code op) /* Initialize the scalarizer. */ gfc_init_loopinfo (&loop); - gfc_add_ss_to_loop (&loop, arrayss); + + /* We add the mask first because the number of iterations is taken + from the last ss, and this breaks if an absent optional argument + is used for mask. */ + if (maskss) gfc_add_ss_to_loop (&loop, maskss); + gfc_add_ss_to_loop (&loop, arrayss); + /* Initialize the loop. */ gfc_conv_ss_startstride (&loop); @@ -5103,10 +5153,14 @@ gfc_conv_intrinsic_minmaxloc (gfc_se * se, gfc_expr * expr, enum tree_code op) if (maskss) { - /* We enclose the above in if (mask) {...}. */ - tmp = gfc_finish_block (&block); + /* We enclose the above in if (mask) {...}. If the mask is an + optional argument, generate IF (.NOT. PRESENT(MASK) + .OR. MASK(I)). */ - tmp = build3_v (COND_EXPR, maskse.expr, tmp, + tree ifmask; + ifmask = conv_mask_condition (&maskse, maskexpr, optional_mask); + tmp = gfc_finish_block (&block); + tmp = build3_v (COND_EXPR, ifmask, tmp, build_empty_stmt (input_location)); } else @@ -5197,10 +5251,14 @@ gfc_conv_intrinsic_minmaxloc (gfc_se * se, gfc_expr * expr, enum tree_code op) if (maskss) { - /* We enclose the above in if (mask) {...}. */ - tmp = gfc_finish_block (&block); + /* We enclose the above in if (mask) {...}. If the mask is + an optional argument, generate IF (.NOT. PRESENT(MASK) + .OR. MASK(I)).*/ - tmp = build3_v (COND_EXPR, maskse.expr, tmp, + tree ifmask; + ifmask = conv_mask_condition (&maskse, maskexpr, optional_mask); + tmp = gfc_finish_block (&block); + tmp = build3_v (COND_EXPR, ifmask, tmp, build_empty_stmt (input_location)); } else @@ -5219,6 +5277,8 @@ gfc_conv_intrinsic_minmaxloc (gfc_se * se, gfc_expr * expr, enum tree_code op) /* For a scalar mask, enclose the loop in an if statement. */ if (maskexpr && maskss == NULL) { + tree ifmask; + gfc_init_se (&maskse, NULL); gfc_conv_expr_val (&maskse, maskexpr); gfc_init_block (&block); @@ -5232,8 +5292,8 @@ gfc_conv_intrinsic_minmaxloc (gfc_se * se, gfc_expr * expr, enum tree_code op) gfc_init_block (&elseblock); gfc_add_modify (&elseblock, pos, gfc_index_zero_node); elsetmp = gfc_finish_block (&elseblock); - - tmp = build3_v (COND_EXPR, maskse.expr, tmp, elsetmp); + ifmask = conv_mask_condition (&maskse, maskexpr, optional_mask); + tmp = build3_v (COND_EXPR, ifmask, tmp, elsetmp); gfc_add_expr_to_block (&block, tmp); gfc_add_block_to_block (&se->pre, &block); } @@ -5276,6 +5336,7 @@ gfc_conv_intrinsic_findloc (gfc_se *se, gfc_expr *expr) gfc_expr *maskexpr; tree offset; int i; + bool optional_mask; array_arg = expr->value.function.actual; value_arg = array_arg->next; @@ -5326,6 +5387,9 @@ gfc_conv_intrinsic_findloc (gfc_se *se, gfc_expr *expr) offset = gfc_create_var (gfc_array_index_type, "offset"); maskexpr = mask_arg->expr; + optional_mask = maskexpr && maskexpr->expr_type == EXPR_VARIABLE + && maskexpr->symtree->n.sym->attr.dummy + && maskexpr->symtree->n.sym->attr.optional; /* Generate two loops, one for BACK=.true. and one for BACK=.false. */ @@ -5347,9 +5411,14 @@ gfc_conv_intrinsic_findloc (gfc_se *se, gfc_expr *expr) gfc_init_loopinfo (&loop); exit_label = gfc_build_label_decl (NULL_TREE); TREE_USED (exit_label) = 1; - gfc_add_ss_to_loop (&loop, arrayss); + + /* We add the mask first because the number of iterations is + taken from the last ss, and this breaks if an absent + optional argument is used for mask. */ + if (maskss) gfc_add_ss_to_loop (&loop, maskss); + gfc_add_ss_to_loop (&loop, arrayss); /* Initialize the loop. */ gfc_conv_ss_startstride (&loop); @@ -5412,8 +5481,16 @@ gfc_conv_intrinsic_findloc (gfc_se *se, gfc_expr *expr) tmp = build3_v (COND_EXPR, tmp, found, build_empty_stmt (input_location)); if (maskss) - tmp = build3_v (COND_EXPR, maskse.expr, tmp, - build_empty_stmt (input_location)); + { + /* We enclose the above in if (mask) {...}. If the mask is + an optional argument, generate IF (.NOT. PRESENT(MASK) + .OR. MASK(I)). */ + + tree ifmask; + ifmask = conv_mask_condition (&maskse, maskexpr, optional_mask); + tmp = build3_v (COND_EXPR, ifmask, tmp, + build_empty_stmt (input_location)); + } gfc_add_expr_to_block (&body, tmp); gfc_add_block_to_block (&body, &arrayse.post); @@ -5444,12 +5521,15 @@ gfc_conv_intrinsic_findloc (gfc_se *se, gfc_expr *expr) /* For a scalar mask, enclose the loop in an if statement. */ if (maskexpr && maskss == NULL) { + tree ifmask; tree if_stmt; + gfc_init_se (&maskse, NULL); gfc_conv_expr_val (&maskse, maskexpr); gfc_init_block (&block); gfc_add_expr_to_block (&block, maskse.expr); - if_stmt = build3_v (COND_EXPR, maskse.expr, tmp, + ifmask = conv_mask_condition (&maskse, maskexpr, optional_mask); + if_stmt = build3_v (COND_EXPR, ifmask, tmp, build_empty_stmt (input_location)); gfc_add_expr_to_block (&block, if_stmt); tmp = gfc_finish_block (&block); @@ -5576,6 +5656,7 @@ gfc_conv_intrinsic_minmaxval (gfc_se * se, gfc_expr * expr, enum tree_code op) gfc_expr *arrayexpr; gfc_expr *maskexpr; int n; + bool optional_mask; if (se->ss) { @@ -5665,6 +5746,9 @@ gfc_conv_intrinsic_minmaxval (gfc_se * se, gfc_expr * expr, enum tree_code op) actual = actual->next->next; gcc_assert (actual); maskexpr = actual->expr; + optional_mask = maskexpr && maskexpr->expr_type == EXPR_VARIABLE + && maskexpr->symtree->n.sym->attr.dummy + && maskexpr->symtree->n.sym->attr.optional; nonempty = NULL; if (maskexpr && maskexpr->rank != 0) { @@ -5687,9 +5771,14 @@ gfc_conv_intrinsic_minmaxval (gfc_se * se, gfc_expr * expr, enum tree_code op) /* Initialize the scalarizer. */ gfc_init_loopinfo (&loop); - gfc_add_ss_to_loop (&loop, arrayss); + + /* We add the mask first because the number of iterations is taken + from the last ss, and this breaks if an absent optional argument + is used for mask. */ + if (maskss) gfc_add_ss_to_loop (&loop, maskss); + gfc_add_ss_to_loop (&loop, arrayss); /* Initialize the loop. */ gfc_conv_ss_startstride (&loop); @@ -5832,9 +5921,15 @@ gfc_conv_intrinsic_minmaxval (gfc_se * se, gfc_expr * expr, enum tree_code op) tmp = gfc_finish_block (&block); if (maskss) - /* We enclose the above in if (mask) {...}. */ - tmp = build3_v (COND_EXPR, maskse.expr, tmp, - build_empty_stmt (input_location)); + { + /* We enclose the above in if (mask) {...}. If the mask is an + optional argument, generate IF (.NOT. PRESENT(MASK) + .OR. MASK(I)). */ + tree ifmask; + ifmask = conv_mask_condition (&maskse, maskexpr, optional_mask); + tmp = build3_v (COND_EXPR, ifmask, tmp, + build_empty_stmt (input_location)); + } gfc_add_expr_to_block (&body, tmp); if (lab) @@ -5891,8 +5986,13 @@ gfc_conv_intrinsic_minmaxval (gfc_se * se, gfc_expr * expr, enum tree_code op) tmp = gfc_finish_block (&block); if (maskss) /* We enclose the above in if (mask) {...}. */ - tmp = build3_v (COND_EXPR, maskse.expr, tmp, - build_empty_stmt (input_location)); + { + tree ifmask; + ifmask = conv_mask_condition (&maskse, maskexpr, optional_mask); + tmp = build3_v (COND_EXPR, ifmask, tmp, + build_empty_stmt (input_location)); + } + gfc_add_expr_to_block (&body, tmp); /* Avoid initializing loopvar[0] again, it should be left where it finished by the first loop. */ @@ -5920,6 +6020,7 @@ gfc_conv_intrinsic_minmaxval (gfc_se * se, gfc_expr * expr, enum tree_code op) if (maskexpr && maskss == NULL) { tree else_stmt; + tree ifmask; gfc_init_se (&maskse, NULL); gfc_conv_expr_val (&maskse, maskexpr); @@ -5932,7 +6033,9 @@ gfc_conv_intrinsic_minmaxval (gfc_se * se, gfc_expr * expr, enum tree_code op) else_stmt = build2_v (MODIFY_EXPR, limit, huge_cst); else else_stmt = build_empty_stmt (input_location); - tmp = build3_v (COND_EXPR, maskse.expr, tmp, else_stmt); + + ifmask = conv_mask_condition (&maskse, maskexpr, optional_mask); + tmp = build3_v (COND_EXPR, ifmask, tmp, else_stmt); gfc_add_expr_to_block (&block, tmp); gfc_add_block_to_block (&se->pre, &block); } @@ -10177,7 +10280,8 @@ gfc_walk_intrinsic_libfunc (gfc_ss * ss, gfc_expr * expr) bool gfc_inline_intrinsic_function_p (gfc_expr *expr) { - gfc_actual_arglist *args; + gfc_actual_arglist *args, *dim_arg, *mask_arg; + gfc_expr *maskexpr; if (!expr->value.function.isym) return false; @@ -10191,10 +10295,25 @@ gfc_inline_intrinsic_function_p (gfc_expr *expr) return false; args = expr->value.function.actual; + dim_arg = args->next; + /* We need to be able to subset the SUM argument at compile-time. */ - if (args->next->expr && args->next->expr->expr_type != EXPR_CONSTANT) + if (dim_arg->expr && dim_arg->expr->expr_type != EXPR_CONSTANT) return false; + /* FIXME: If MASK is optional for a more than two-dimensional + argument, the scalarizer gets confused if the mask is + absent. See PR 82995. For now, fall back to the library + function. */ + + mask_arg = dim_arg->next; + maskexpr = mask_arg->expr; + + if (expr->rank > 0 && maskexpr && maskexpr->expr_type == EXPR_VARIABLE + && maskexpr->symtree->n.sym->attr.dummy + && maskexpr->symtree->n.sym->attr.optional) + return false; + return true; case GFC_ISYM_TRANSPOSE: diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 273ea1149dc..c5ca8d97958 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2018-12-31 Thomas Koenig + + PR fortran/82995 + * gfortran.dg/optional_absent_4.f90: New test. + * gfortran.dg/optional_absent_5.f90: New test. + 2018-12-31 Martin Liska * g++.dg/tree-prof/devirt.C: Fix scan pattern and test options. diff --git a/gcc/testsuite/gfortran.dg/optional_absent_4.f90 b/gcc/testsuite/gfortran.dg/optional_absent_4.f90 new file mode 100644 index 00000000000..76470bd46cd --- /dev/null +++ b/gcc/testsuite/gfortran.dg/optional_absent_4.f90 @@ -0,0 +1,96 @@ +! { dg-do run } +! PR 82995 - segfault passing on an optional argument; +! this tests the inline versions. +module y + implicit none +contains + + function sum_1 (input, mask) + logical, intent(in), optional :: mask(:) + integer, intent(in) :: input(:) + integer :: sum_1 + sum_1 = sum (input, mask) + end function sum_1 + + function sum_2 (input, mask) + logical, intent(in), optional :: mask + integer, intent(in) :: input(:) + integer :: sum_2 + sum_2 = sum(input, mask) + end function sum_2 + + function sum_3 (input, mask) + logical, intent(in), optional :: mask(:,:) + integer, intent(in) :: input(:,:) + integer :: sum_3 + sum_3 = sum (input, mask) + end function sum_3 + + function minval_1 (input, mask) + logical, intent(in), optional :: mask(:,:) + real, intent(in) :: input(:,:) + real :: minval_1 + minval_1 = minval (input, mask) + end function minval_1 + + function maxval_1 (input, mask) + logical, intent(in), optional :: mask + real, intent(in) :: input(:,:) + real :: maxval_1 + maxval_1 = maxval (input, mask) + end function maxval_1 + + function maxloc_1 (input, mask) + logical, intent(in), optional :: mask(:) + real, intent(in) :: input(:) + integer :: maxloc_1 + + maxloc_1 = maxloc(input, dim=1, mask=mask) + end function maxloc_1 + + function findloc_1 (input, val, mask) + logical, intent(in), optional :: mask (:) + integer, intent(in) :: input(:) + integer, intent(in) :: val + integer :: findloc_1 + + findloc_1 = findloc(input, val, dim=1, mask=mask) + end function findloc_1 + + function findloc_2 (input, val, mask) + logical, intent(in), optional :: mask + integer, intent(in) :: input(:) + integer, intent(in) :: val + integer :: findloc_2 + + findloc_2 = findloc(input, val, dim=1, mask=mask) + end function findloc_2 + +end module y + +program test_sum_1 + use y + implicit none + integer :: input(5) = [1,2,4,8,16] + integer :: i2(2,3) = reshape([1,2,4,8,16,32], [2,3]) + real :: r2(2,3) = reshape ([32.,16.,8.,4.,2.,1.], [2,3]) + real :: r1(6) = [2.,4.,8.,32.,1.,16.] + integer :: res + real :: rres + res = sum_1(input) + if (res /= 31) stop 1 + res = sum_2 (input) + if (res /= 31) stop 2 + res = sum_3 (i2) + if (res /= 63) stop 3 + rres = minval_1 (r2) + if (rres /= 1.0) stop 4 + rres = maxval_1 (r2) + if (rres /= 32.) stop 5 + res = maxloc_1 (r1) + if (res /= 4) stop 6 + res = findloc_1 (input, 8) + if (res /= 4) stop 7 + res = findloc_2 (input, 2) + if (res /= 2) stop 8 +end program test_sum_1 diff --git a/gcc/testsuite/gfortran.dg/optional_absent_5.f90 b/gcc/testsuite/gfortran.dg/optional_absent_5.f90 new file mode 100644 index 00000000000..42f1a91bcb1 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/optional_absent_5.f90 @@ -0,0 +1,144 @@ +! { dg-do run } +! PR 82995 - segfault passing on an optional argument; +! this tests the library versions. +module z + implicit none +contains + subroutine sum_1 (input, res, mask) + logical, intent(in), optional :: mask(:,:) + integer, intent(in) :: input(:,:) + integer, dimension(:), intent(out) :: res + res = sum (input, dim=1, mask=mask) + end subroutine sum_1 + + subroutine sum_2 (input, res, mask) + logical, intent(in), optional :: mask + integer, intent(in) :: input(:,:) + integer, dimension(:), intent(out) :: res + res = sum (input, dim=1, mask=mask) + end subroutine sum_2 + + subroutine maxloc_1 (input, res, mask) + logical, intent(in), optional :: mask(:,:) + integer, intent(in) :: input(:,:) + integer, dimension(:), intent(out) :: res + res = maxloc (input, dim=1, mask=mask) + end subroutine maxloc_1 + + subroutine minloc_1 (input, res, mask) + logical, intent(in), optional :: mask + integer, intent(in) :: input(:,:) + integer, dimension(:), intent(out) :: res + res = minloc (input, dim=1, mask=mask) + end subroutine minloc_1 + + subroutine maxloc_2 (input, res, mask) + logical, intent(in), optional :: mask(:,:) + integer, intent(in) :: input(:,:) + integer, dimension(:), intent(out) :: res + integer :: n + n = 1 + res = maxloc (input, dim=n, mask=mask) + end subroutine maxloc_2 + + subroutine findloc_1 (input, val, res, mask) + logical, intent(in), optional :: mask(:,:) + integer, intent(in) :: input(:,:) + integer, dimension(:), intent(out) :: res + integer, intent(in) :: val + res = findloc(input, val) + end subroutine findloc_1 + + subroutine findloc_2 (input, val, res, mask) + logical, intent(in), optional :: mask + integer, intent(in) :: input(:,:) + integer, dimension(:), intent(out) :: res + integer, intent(in) :: val + res = findloc(input, val) + end subroutine findloc_2 + + subroutine findloc_3 (input, val, res, mask) + logical, intent(in), optional :: mask(:,:) + integer, intent(in) :: input(:,:) + integer, dimension(:), intent(out) :: res + integer, intent(in) :: val + res = findloc(input, val, dim=1) + end subroutine findloc_3 + + subroutine findloc_4 (input, val, res, mask) + logical, intent(in), optional :: mask(:,:) + integer, intent(in) :: input(:,:) + integer, dimension(:), intent(out) :: res + integer, intent(in) :: val + integer :: n = 1 + res = findloc(input, val, dim=n) + end subroutine findloc_4 + + subroutine maxval_1 (input, res, mask) + logical, intent(in), optional :: mask + integer, intent(in) :: input(:,:) + integer, dimension(:), intent(out) :: res + res = maxval (input, dim=1, mask=mask) + end subroutine maxval_1 + + subroutine maxval_2 (input, res, mask) + logical, intent(in), optional :: mask + integer, intent(in) :: input(:,:) + integer, dimension(:), intent(out) :: res + integer :: n = 1 + res = maxval (input, dim=n, mask=mask) + end subroutine maxval_2 + + subroutine minval_1 (input, res, mask) + logical, intent(in), optional :: mask(:,:) + integer, intent(in) :: input(:,:) + integer, dimension(:), intent(out) :: res + res = minval (input, dim=1, mask=mask) + end subroutine minval_1 + + subroutine minval_2 (input, res, mask) + logical, intent(in), optional :: mask(:,:) + integer, intent(in) :: input(:,:) + integer, dimension(:), intent(out) :: res + integer :: n = 1 + res = minval (input, dim=n, mask=mask) + end subroutine minval_2 + +end module z + +program main + use z + implicit none + integer :: i2(2,3) = reshape([1,2,4,8,16,32], [2,3]) + integer, dimension(3) :: res3 + integer, dimension(2) :: res2 + call sum_1 (i2, res3) + if (any (res3 /= [3, 12, 48])) stop 1 + res3 = -2 + call sum_2 (i2, res3) + if (any (res3 /= [3, 12, 48])) stop 2 + call maxloc_1 (i2, res3) + if (any (res3 /= 2)) stop 3 + call minloc_1 (i2, res3) + if (any (res3 /= 1)) stop 4 + call maxloc_2 (i2, res3) + if (any (res3 /= 2)) stop 5 + call findloc_1 (i2, 4, res2) + if (any(res2 /= [1,2])) stop 6 + res2 = -1234 + call findloc_2 (i2, 4, res2) + if (any(res2 /= [1,2])) stop 7 + call findloc_3 (i2, 4, res3) + if (any(res3 /= [0,1,0])) stop 8 + call findloc_4 (i2, 4, res3) + if (any(res3 /= [0,1,0])) stop 9 + call maxval_1 (i2, res3) + if (any (res3 /= [2,8,32])) stop 10 + call minval_1 (i2, res3) + if (any (res3 /= [1,4,16])) stop 11 + call maxval_2 (i2, res3) + if (any (res3 /= [2,8,32])) stop 12 + call minval_2 (i2, res3) + if (any (res3 /= [1,4,16])) stop 13 + +end program main diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index ab0dd2115ff..6df47da16d5 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,3 +1,245 @@ +2018-12-31 Thomas Koenig + + PR fortran/82995 + * m4/ifindloc0.m4: Handle case of absend optional argument, passed + as a NULL pointer. Correct allocation of retarray->base_addr. + * m4/ifindloc1.m4: Likewise. + * m4/ifindloc2.m4: Handle case of absend optional argument, passed + as a NULL pointer. + * m4/iforeach-s.m4: Likewise. + * m4/iforeach-s2.m4: Likewise. + * m4/iforeach.m4: Likewise. + * m4/ifunction-s.m4: Likewise. + * m4/ifunction-s2.m4: Likewise. + * m4/ifunction.m4: Likewise. + * generated/findloc0_c16.c: Regenerated. + * generated/findloc0_c4.c: Regenerated. + * generated/findloc0_c8.c: Regenerated. + * generated/findloc0_i1.c: Regenerated. + * generated/findloc0_i16.c: Regenerated. + * generated/findloc0_i2.c: Regenerated. + * generated/findloc0_i4.c: Regenerated. + * generated/findloc0_i8.c: Regenerated. + * generated/findloc0_r16.c: Regenerated. + * generated/findloc0_r4.c: Regenerated. + * generated/findloc0_r8.c: Regenerated. + * generated/findloc0_s1.c: Regenerated. + * generated/findloc0_s4.c: Regenerated. + * generated/findloc1_c16.c: Regenerated. + * generated/findloc1_c4.c: Regenerated. + * generated/findloc1_c8.c: Regenerated. + * generated/findloc1_i1.c: Regenerated. + * generated/findloc1_i16.c: Regenerated. + * generated/findloc1_i2.c: Regenerated. + * generated/findloc1_i4.c: Regenerated. + * generated/findloc1_i8.c: Regenerated. + * generated/findloc1_r16.c: Regenerated. + * generated/findloc1_r4.c: Regenerated. + * generated/findloc1_r8.c: Regenerated. + * generated/findloc1_s1.c: Regenerated. + * generated/findloc1_s4.c: Regenerated. + * generated/findloc2_s1.c: Regenerated. + * generated/findloc2_s4.c: Regenerated. + * generated/iall_i1.c: Regenerated. + * generated/iall_i16.c: Regenerated. + * generated/iall_i2.c: Regenerated. + * generated/iall_i4.c: Regenerated. + * generated/iall_i8.c: Regenerated. + * generated/iany_i1.c: Regenerated. + * generated/iany_i16.c: Regenerated. + * generated/iany_i2.c: Regenerated. + * generated/iany_i4.c: Regenerated. + * generated/iany_i8.c: Regenerated. + * generated/iparity_i1.c: Regenerated. + * generated/iparity_i16.c: Regenerated. + * generated/iparity_i2.c: Regenerated. + * generated/iparity_i4.c: Regenerated. + * generated/iparity_i8.c: Regenerated. + * generated/maxloc0_16_i1.c: Regenerated. + * generated/maxloc0_16_i16.c: Regenerated. + * generated/maxloc0_16_i2.c: Regenerated. + * generated/maxloc0_16_i4.c: Regenerated. + * generated/maxloc0_16_i8.c: Regenerated. + * generated/maxloc0_16_r10.c: Regenerated. + * generated/maxloc0_16_r16.c: Regenerated. + * generated/maxloc0_16_r4.c: Regenerated. + * generated/maxloc0_16_r8.c: Regenerated. + * generated/maxloc0_16_s1.c: Regenerated. + * generated/maxloc0_16_s4.c: Regenerated. + * generated/maxloc0_4_i1.c: Regenerated. + * generated/maxloc0_4_i16.c: Regenerated. + * generated/maxloc0_4_i2.c: Regenerated. + * generated/maxloc0_4_i4.c: Regenerated. + * generated/maxloc0_4_i8.c: Regenerated. + * generated/maxloc0_4_r10.c: Regenerated. + * generated/maxloc0_4_r16.c: Regenerated. + * generated/maxloc0_4_r4.c: Regenerated. + * generated/maxloc0_4_r8.c: Regenerated. + * generated/maxloc0_4_s1.c: Regenerated. + * generated/maxloc0_4_s4.c: Regenerated. + * generated/maxloc0_8_i1.c: Regenerated. + * generated/maxloc0_8_i16.c: Regenerated. + * generated/maxloc0_8_i2.c: Regenerated. + * generated/maxloc0_8_i4.c: Regenerated. + * generated/maxloc0_8_i8.c: Regenerated. + * generated/maxloc0_8_r10.c: Regenerated. + * generated/maxloc0_8_r16.c: Regenerated. + * generated/maxloc0_8_r4.c: Regenerated. + * generated/maxloc0_8_r8.c: Regenerated. + * generated/maxloc0_8_s1.c: Regenerated. + * generated/maxloc0_8_s4.c: Regenerated. + * generated/maxloc1_16_i1.c: Regenerated. + * generated/maxloc1_16_i16.c: Regenerated. + * generated/maxloc1_16_i2.c: Regenerated. + * generated/maxloc1_16_i4.c: Regenerated. + * generated/maxloc1_16_i8.c: Regenerated. + * generated/maxloc1_16_r10.c: Regenerated. + * generated/maxloc1_16_r16.c: Regenerated. + * generated/maxloc1_16_r4.c: Regenerated. + * generated/maxloc1_16_r8.c: Regenerated. + * generated/maxloc1_16_s1.c: Regenerated. + * generated/maxloc1_16_s4.c: Regenerated. + * generated/maxloc1_4_i1.c: Regenerated. + * generated/maxloc1_4_i16.c: Regenerated. + * generated/maxloc1_4_i2.c: Regenerated. + * generated/maxloc1_4_i4.c: Regenerated. + * generated/maxloc1_4_i8.c: Regenerated. + * generated/maxloc1_4_r10.c: Regenerated. + * generated/maxloc1_4_r16.c: Regenerated. + * generated/maxloc1_4_r4.c: Regenerated. + * generated/maxloc1_4_r8.c: Regenerated. + * generated/maxloc1_4_s1.c: Regenerated. + * generated/maxloc1_4_s4.c: Regenerated. + * generated/maxloc1_8_i1.c: Regenerated. + * generated/maxloc1_8_i16.c: Regenerated. + * generated/maxloc1_8_i2.c: Regenerated. + * generated/maxloc1_8_i4.c: Regenerated. + * generated/maxloc1_8_i8.c: Regenerated. + * generated/maxloc1_8_r10.c: Regenerated. + * generated/maxloc1_8_r16.c: Regenerated. + * generated/maxloc1_8_r4.c: Regenerated. + * generated/maxloc1_8_r8.c: Regenerated. + * generated/maxloc1_8_s1.c: Regenerated. + * generated/maxloc1_8_s4.c: Regenerated. + * generated/maxval0_s1.c: Regenerated. + * generated/maxval0_s4.c: Regenerated. + * generated/maxval1_s1.c: Regenerated. + * generated/maxval1_s4.c: Regenerated. + * generated/maxval_i1.c: Regenerated. + * generated/maxval_i16.c: Regenerated. + * generated/maxval_i2.c: Regenerated. + * generated/maxval_i4.c: Regenerated. + * generated/maxval_i8.c: Regenerated. + * generated/maxval_r10.c: Regenerated. + * generated/maxval_r16.c: Regenerated. + * generated/maxval_r4.c: Regenerated. + * generated/maxval_r8.c: Regenerated. + * generated/minloc0_16_i1.c: Regenerated. + * generated/minloc0_16_i16.c: Regenerated. + * generated/minloc0_16_i2.c: Regenerated. + * generated/minloc0_16_i4.c: Regenerated. + * generated/minloc0_16_i8.c: Regenerated. + * generated/minloc0_16_r10.c: Regenerated. + * generated/minloc0_16_r16.c: Regenerated. + * generated/minloc0_16_r4.c: Regenerated. + * generated/minloc0_16_r8.c: Regenerated. + * generated/minloc0_16_s1.c: Regenerated. + * generated/minloc0_16_s4.c: Regenerated. + * generated/minloc0_4_i1.c: Regenerated. + * generated/minloc0_4_i16.c: Regenerated. + * generated/minloc0_4_i2.c: Regenerated. + * generated/minloc0_4_i4.c: Regenerated. + * generated/minloc0_4_i8.c: Regenerated. + * generated/minloc0_4_r10.c: Regenerated. + * generated/minloc0_4_r16.c: Regenerated. + * generated/minloc0_4_r4.c: Regenerated. + * generated/minloc0_4_r8.c: Regenerated. + * generated/minloc0_4_s1.c: Regenerated. + * generated/minloc0_4_s4.c: Regenerated. + * generated/minloc0_8_i1.c: Regenerated. + * generated/minloc0_8_i16.c: Regenerated. + * generated/minloc0_8_i2.c: Regenerated. + * generated/minloc0_8_i4.c: Regenerated. + * generated/minloc0_8_i8.c: Regenerated. + * generated/minloc0_8_r10.c: Regenerated. + * generated/minloc0_8_r16.c: Regenerated. + * generated/minloc0_8_r4.c: Regenerated. + * generated/minloc0_8_r8.c: Regenerated. + * generated/minloc0_8_s1.c: Regenerated. + * generated/minloc0_8_s4.c: Regenerated. + * generated/minloc1_16_i1.c: Regenerated. + * generated/minloc1_16_i16.c: Regenerated. + * generated/minloc1_16_i2.c: Regenerated. + * generated/minloc1_16_i4.c: Regenerated. + * generated/minloc1_16_i8.c: Regenerated. + * generated/minloc1_16_r10.c: Regenerated. + * generated/minloc1_16_r16.c: Regenerated. + * generated/minloc1_16_r4.c: Regenerated. + * generated/minloc1_16_r8.c: Regenerated. + * generated/minloc1_16_s1.c: Regenerated. + * generated/minloc1_16_s4.c: Regenerated. + * generated/minloc1_4_i1.c: Regenerated. + * generated/minloc1_4_i16.c: Regenerated. + * generated/minloc1_4_i2.c: Regenerated. + * generated/minloc1_4_i4.c: Regenerated. + * generated/minloc1_4_i8.c: Regenerated. + * generated/minloc1_4_r10.c: Regenerated. + * generated/minloc1_4_r16.c: Regenerated. + * generated/minloc1_4_r4.c: Regenerated. + * generated/minloc1_4_r8.c: Regenerated. + * generated/minloc1_4_s1.c: Regenerated. + * generated/minloc1_4_s4.c: Regenerated. + * generated/minloc1_8_i1.c: Regenerated. + * generated/minloc1_8_i16.c: Regenerated. + * generated/minloc1_8_i2.c: Regenerated. + * generated/minloc1_8_i4.c: Regenerated. + * generated/minloc1_8_i8.c: Regenerated. + * generated/minloc1_8_r10.c: Regenerated. + * generated/minloc1_8_r16.c: Regenerated. + * generated/minloc1_8_r4.c: Regenerated. + * generated/minloc1_8_r8.c: Regenerated. + * generated/minloc1_8_s1.c: Regenerated. + * generated/minloc1_8_s4.c: Regenerated. + * generated/minval0_s1.c: Regenerated. + * generated/minval0_s4.c: Regenerated. + * generated/minval1_s1.c: Regenerated. + * generated/minval1_s4.c: Regenerated. + * generated/minval_i1.c: Regenerated. + * generated/minval_i16.c: Regenerated. + * generated/minval_i2.c: Regenerated. + * generated/minval_i4.c: Regenerated. + * generated/minval_i8.c: Regenerated. + * generated/minval_r10.c: Regenerated. + * generated/minval_r16.c: Regenerated. + * generated/minval_r4.c: Regenerated. + * generated/minval_r8.c: Regenerated. + * generated/product_c10.c: Regenerated. + * generated/product_c16.c: Regenerated. + * generated/product_c4.c: Regenerated. + * generated/product_c8.c: Regenerated. + * generated/product_i1.c: Regenerated. + * generated/product_i16.c: Regenerated. + * generated/product_i2.c: Regenerated. + * generated/product_i4.c: Regenerated. + * generated/product_i8.c: Regenerated. + * generated/product_r10.c: Regenerated. + * generated/product_r16.c: Regenerated. + * generated/product_r4.c: Regenerated. + * generated/product_r8.c: Regenerated. + * generated/sum_c10.c: Regenerated. + * generated/sum_c16.c: Regenerated. + * generated/sum_c4.c: Regenerated. + * generated/sum_c8.c: Regenerated. + * generated/sum_i1.c: Regenerated. + * generated/sum_i16.c: Regenerated. + * generated/sum_i2.c: Regenerated. + * generated/sum_i4.c: Regenerated. + * generated/sum_i8.c: Regenerated. + * generated/sum_r10.c: Regenerated. + * generated/sum_r16.c: Regenerated. + * generated/sum_r4.c: Regenerated. + * generated/sum_r8.c: Regenerated. + 2018-12-29 Steven G. Kargl * gfortran.map: Expose subnormal functions in dynamic library. @@ -7,7 +249,7 @@ * ieee/ieee_features.F90: Add IEEE_SUBNORMAL. 2018-12-29 Steven G. Kargl - + PR fortran/88342 * ieee/ieee_arithmetic.F90: Prevent exceptions in IEEE_VALUE if -ffpe-trap=invalid or -ffpe-trap=overflow is used. diff --git a/libgfortran/generated/findloc0_c16.c b/libgfortran/generated/findloc0_c16.c index 8afb0c553cb..9bbed7baab9 100644 --- a/libgfortran/generated/findloc0_c16.c +++ b/libgfortran/generated/findloc0_c16.c @@ -57,7 +57,7 @@ findloc0_c16 (gfc_array_index_type * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype.rank = 1; retarray->offset = 0; - retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4)); + retarray->base_addr = xmallocarray (rank, sizeof (index_type)); } else { @@ -196,7 +196,7 @@ mfindloc0_c16 (gfc_array_index_type * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype.rank = 1; retarray->offset = 0; - retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4)); + retarray->base_addr = xmallocarray (rank, sizeof (index_type)); } else { @@ -342,7 +342,7 @@ sfindloc0_c16 (gfc_array_index_type * const restrict retarray, index_type * restrict dest; index_type n; - if (*mask) + if (mask == NULL || *mask) { findloc0_c16 (retarray, array, value, back); return; @@ -358,7 +358,7 @@ sfindloc0_c16 (gfc_array_index_type * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype.rank = 1; retarray->offset = 0; - retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4)); + retarray->base_addr = xmallocarray (rank, sizeof (index_type)); } else if (unlikely (compile_options.bounds_check)) { diff --git a/libgfortran/generated/findloc0_c4.c b/libgfortran/generated/findloc0_c4.c index 42f010bb5c1..3a141781f60 100644 --- a/libgfortran/generated/findloc0_c4.c +++ b/libgfortran/generated/findloc0_c4.c @@ -57,7 +57,7 @@ findloc0_c4 (gfc_array_index_type * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype.rank = 1; retarray->offset = 0; - retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4)); + retarray->base_addr = xmallocarray (rank, sizeof (index_type)); } else { @@ -196,7 +196,7 @@ mfindloc0_c4 (gfc_array_index_type * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype.rank = 1; retarray->offset = 0; - retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4)); + retarray->base_addr = xmallocarray (rank, sizeof (index_type)); } else { @@ -342,7 +342,7 @@ sfindloc0_c4 (gfc_array_index_type * const restrict retarray, index_type * restrict dest; index_type n; - if (*mask) + if (mask == NULL || *mask) { findloc0_c4 (retarray, array, value, back); return; @@ -358,7 +358,7 @@ sfindloc0_c4 (gfc_array_index_type * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype.rank = 1; retarray->offset = 0; - retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4)); + retarray->base_addr = xmallocarray (rank, sizeof (index_type)); } else if (unlikely (compile_options.bounds_check)) { diff --git a/libgfortran/generated/findloc0_c8.c b/libgfortran/generated/findloc0_c8.c index 8eb73035140..c67eba58c2f 100644 --- a/libgfortran/generated/findloc0_c8.c +++ b/libgfortran/generated/findloc0_c8.c @@ -57,7 +57,7 @@ findloc0_c8 (gfc_array_index_type * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype.rank = 1; retarray->offset = 0; - retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4)); + retarray->base_addr = xmallocarray (rank, sizeof (index_type)); } else { @@ -196,7 +196,7 @@ mfindloc0_c8 (gfc_array_index_type * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype.rank = 1; retarray->offset = 0; - retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4)); + retarray->base_addr = xmallocarray (rank, sizeof (index_type)); } else { @@ -342,7 +342,7 @@ sfindloc0_c8 (gfc_array_index_type * const restrict retarray, index_type * restrict dest; index_type n; - if (*mask) + if (mask == NULL || *mask) { findloc0_c8 (retarray, array, value, back); return; @@ -358,7 +358,7 @@ sfindloc0_c8 (gfc_array_index_type * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype.rank = 1; retarray->offset = 0; - retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4)); + retarray->base_addr = xmallocarray (rank, sizeof (index_type)); } else if (unlikely (compile_options.bounds_check)) { diff --git a/libgfortran/generated/findloc0_i1.c b/libgfortran/generated/findloc0_i1.c index 76b5400a50e..4a2193452e1 100644 --- a/libgfortran/generated/findloc0_i1.c +++ b/libgfortran/generated/findloc0_i1.c @@ -57,7 +57,7 @@ findloc0_i1 (gfc_array_index_type * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype.rank = 1; retarray->offset = 0; - retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4)); + retarray->base_addr = xmallocarray (rank, sizeof (index_type)); } else { @@ -196,7 +196,7 @@ mfindloc0_i1 (gfc_array_index_type * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype.rank = 1; retarray->offset = 0; - retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4)); + retarray->base_addr = xmallocarray (rank, sizeof (index_type)); } else { @@ -342,7 +342,7 @@ sfindloc0_i1 (gfc_array_index_type * const restrict retarray, index_type * restrict dest; index_type n; - if (*mask) + if (mask == NULL || *mask) { findloc0_i1 (retarray, array, value, back); return; @@ -358,7 +358,7 @@ sfindloc0_i1 (gfc_array_index_type * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype.rank = 1; retarray->offset = 0; - retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4)); + retarray->base_addr = xmallocarray (rank, sizeof (index_type)); } else if (unlikely (compile_options.bounds_check)) { diff --git a/libgfortran/generated/findloc0_i16.c b/libgfortran/generated/findloc0_i16.c index bdfd69a6c0b..662df29c7e0 100644 --- a/libgfortran/generated/findloc0_i16.c +++ b/libgfortran/generated/findloc0_i16.c @@ -57,7 +57,7 @@ findloc0_i16 (gfc_array_index_type * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype.rank = 1; retarray->offset = 0; - retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4)); + retarray->base_addr = xmallocarray (rank, sizeof (index_type)); } else { @@ -196,7 +196,7 @@ mfindloc0_i16 (gfc_array_index_type * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype.rank = 1; retarray->offset = 0; - retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4)); + retarray->base_addr = xmallocarray (rank, sizeof (index_type)); } else { @@ -342,7 +342,7 @@ sfindloc0_i16 (gfc_array_index_type * const restrict retarray, index_type * restrict dest; index_type n; - if (*mask) + if (mask == NULL || *mask) { findloc0_i16 (retarray, array, value, back); return; @@ -358,7 +358,7 @@ sfindloc0_i16 (gfc_array_index_type * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype.rank = 1; retarray->offset = 0; - retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4)); + retarray->base_addr = xmallocarray (rank, sizeof (index_type)); } else if (unlikely (compile_options.bounds_check)) { diff --git a/libgfortran/generated/findloc0_i2.c b/libgfortran/generated/findloc0_i2.c index 712262fc8ba..273248cba79 100644 --- a/libgfortran/generated/findloc0_i2.c +++ b/libgfortran/generated/findloc0_i2.c @@ -57,7 +57,7 @@ findloc0_i2 (gfc_array_index_type * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype.rank = 1; retarray->offset = 0; - retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4)); + retarray->base_addr = xmallocarray (rank, sizeof (index_type)); } else { @@ -196,7 +196,7 @@ mfindloc0_i2 (gfc_array_index_type * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype.rank = 1; retarray->offset = 0; - retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4)); + retarray->base_addr = xmallocarray (rank, sizeof (index_type)); } else { @@ -342,7 +342,7 @@ sfindloc0_i2 (gfc_array_index_type * const restrict retarray, index_type * restrict dest; index_type n; - if (*mask) + if (mask == NULL || *mask) { findloc0_i2 (retarray, array, value, back); return; @@ -358,7 +358,7 @@ sfindloc0_i2 (gfc_array_index_type * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype.rank = 1; retarray->offset = 0; - retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4)); + retarray->base_addr = xmallocarray (rank, sizeof (index_type)); } else if (unlikely (compile_options.bounds_check)) { diff --git a/libgfortran/generated/findloc0_i4.c b/libgfortran/generated/findloc0_i4.c index db72489d247..0eb611b5a4c 100644 --- a/libgfortran/generated/findloc0_i4.c +++ b/libgfortran/generated/findloc0_i4.c @@ -57,7 +57,7 @@ findloc0_i4 (gfc_array_index_type * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype.rank = 1; retarray->offset = 0; - retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4)); + retarray->base_addr = xmallocarray (rank, sizeof (index_type)); } else { @@ -196,7 +196,7 @@ mfindloc0_i4 (gfc_array_index_type * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype.rank = 1; retarray->offset = 0; - retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4)); + retarray->base_addr = xmallocarray (rank, sizeof (index_type)); } else { @@ -342,7 +342,7 @@ sfindloc0_i4 (gfc_array_index_type * const restrict retarray, index_type * restrict dest; index_type n; - if (*mask) + if (mask == NULL || *mask) { findloc0_i4 (retarray, array, value, back); return; @@ -358,7 +358,7 @@ sfindloc0_i4 (gfc_array_index_type * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype.rank = 1; retarray->offset = 0; - retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4)); + retarray->base_addr = xmallocarray (rank, sizeof (index_type)); } else if (unlikely (compile_options.bounds_check)) { diff --git a/libgfortran/generated/findloc0_i8.c b/libgfortran/generated/findloc0_i8.c index 6fb3e2cdbb2..ef48de04763 100644 --- a/libgfortran/generated/findloc0_i8.c +++ b/libgfortran/generated/findloc0_i8.c @@ -57,7 +57,7 @@ findloc0_i8 (gfc_array_index_type * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype.rank = 1; retarray->offset = 0; - retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4)); + retarray->base_addr = xmallocarray (rank, sizeof (index_type)); } else { @@ -196,7 +196,7 @@ mfindloc0_i8 (gfc_array_index_type * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype.rank = 1; retarray->offset = 0; - retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4)); + retarray->base_addr = xmallocarray (rank, sizeof (index_type)); } else { @@ -342,7 +342,7 @@ sfindloc0_i8 (gfc_array_index_type * const restrict retarray, index_type * restrict dest; index_type n; - if (*mask) + if (mask == NULL || *mask) { findloc0_i8 (retarray, array, value, back); return; @@ -358,7 +358,7 @@ sfindloc0_i8 (gfc_array_index_type * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype.rank = 1; retarray->offset = 0; - retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4)); + retarray->base_addr = xmallocarray (rank, sizeof (index_type)); } else if (unlikely (compile_options.bounds_check)) { diff --git a/libgfortran/generated/findloc0_r16.c b/libgfortran/generated/findloc0_r16.c index 23ecd98a55d..ca3c7509ed4 100644 --- a/libgfortran/generated/findloc0_r16.c +++ b/libgfortran/generated/findloc0_r16.c @@ -57,7 +57,7 @@ findloc0_r16 (gfc_array_index_type * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype.rank = 1; retarray->offset = 0; - retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4)); + retarray->base_addr = xmallocarray (rank, sizeof (index_type)); } else { @@ -196,7 +196,7 @@ mfindloc0_r16 (gfc_array_index_type * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype.rank = 1; retarray->offset = 0; - retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4)); + retarray->base_addr = xmallocarray (rank, sizeof (index_type)); } else { @@ -342,7 +342,7 @@ sfindloc0_r16 (gfc_array_index_type * const restrict retarray, index_type * restrict dest; index_type n; - if (*mask) + if (mask == NULL || *mask) { findloc0_r16 (retarray, array, value, back); return; @@ -358,7 +358,7 @@ sfindloc0_r16 (gfc_array_index_type * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype.rank = 1; retarray->offset = 0; - retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4)); + retarray->base_addr = xmallocarray (rank, sizeof (index_type)); } else if (unlikely (compile_options.bounds_check)) { diff --git a/libgfortran/generated/findloc0_r4.c b/libgfortran/generated/findloc0_r4.c index 08d59e956b2..f1dd1c3df3b 100644 --- a/libgfortran/generated/findloc0_r4.c +++ b/libgfortran/generated/findloc0_r4.c @@ -57,7 +57,7 @@ findloc0_r4 (gfc_array_index_type * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype.rank = 1; retarray->offset = 0; - retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4)); + retarray->base_addr = xmallocarray (rank, sizeof (index_type)); } else { @@ -196,7 +196,7 @@ mfindloc0_r4 (gfc_array_index_type * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype.rank = 1; retarray->offset = 0; - retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4)); + retarray->base_addr = xmallocarray (rank, sizeof (index_type)); } else { @@ -342,7 +342,7 @@ sfindloc0_r4 (gfc_array_index_type * const restrict retarray, index_type * restrict dest; index_type n; - if (*mask) + if (mask == NULL || *mask) { findloc0_r4 (retarray, array, value, back); return; @@ -358,7 +358,7 @@ sfindloc0_r4 (gfc_array_index_type * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype.rank = 1; retarray->offset = 0; - retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4)); + retarray->base_addr = xmallocarray (rank, sizeof (index_type)); } else if (unlikely (compile_options.bounds_check)) { diff --git a/libgfortran/generated/findloc0_r8.c b/libgfortran/generated/findloc0_r8.c index c7315318b86..31e39b03321 100644 --- a/libgfortran/generated/findloc0_r8.c +++ b/libgfortran/generated/findloc0_r8.c @@ -57,7 +57,7 @@ findloc0_r8 (gfc_array_index_type * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype.rank = 1; retarray->offset = 0; - retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4)); + retarray->base_addr = xmallocarray (rank, sizeof (index_type)); } else { @@ -196,7 +196,7 @@ mfindloc0_r8 (gfc_array_index_type * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype.rank = 1; retarray->offset = 0; - retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4)); + retarray->base_addr = xmallocarray (rank, sizeof (index_type)); } else { @@ -342,7 +342,7 @@ sfindloc0_r8 (gfc_array_index_type * const restrict retarray, index_type * restrict dest; index_type n; - if (*mask) + if (mask == NULL || *mask) { findloc0_r8 (retarray, array, value, back); return; @@ -358,7 +358,7 @@ sfindloc0_r8 (gfc_array_index_type * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype.rank = 1; retarray->offset = 0; - retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4)); + retarray->base_addr = xmallocarray (rank, sizeof (index_type)); } else if (unlikely (compile_options.bounds_check)) { diff --git a/libgfortran/generated/findloc0_s1.c b/libgfortran/generated/findloc0_s1.c index 3b0f9b07349..e42c44a1914 100644 --- a/libgfortran/generated/findloc0_s1.c +++ b/libgfortran/generated/findloc0_s1.c @@ -58,7 +58,7 @@ findloc0_s1 (gfc_array_index_type * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype.rank = 1; retarray->offset = 0; - retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4)); + retarray->base_addr = xmallocarray (rank, sizeof (index_type)); } else { @@ -199,7 +199,7 @@ mfindloc0_s1 (gfc_array_index_type * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype.rank = 1; retarray->offset = 0; - retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4)); + retarray->base_addr = xmallocarray (rank, sizeof (index_type)); } else { @@ -347,7 +347,7 @@ sfindloc0_s1 (gfc_array_index_type * const restrict retarray, index_type * restrict dest; index_type n; - if (*mask) + if (mask == NULL || *mask) { findloc0_s1 (retarray, array, value, back, len_array, len_value); return; @@ -363,7 +363,7 @@ sfindloc0_s1 (gfc_array_index_type * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype.rank = 1; retarray->offset = 0; - retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4)); + retarray->base_addr = xmallocarray (rank, sizeof (index_type)); } else if (unlikely (compile_options.bounds_check)) { diff --git a/libgfortran/generated/findloc0_s4.c b/libgfortran/generated/findloc0_s4.c index fa23503a894..bdf71c56f4e 100644 --- a/libgfortran/generated/findloc0_s4.c +++ b/libgfortran/generated/findloc0_s4.c @@ -58,7 +58,7 @@ findloc0_s4 (gfc_array_index_type * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype.rank = 1; retarray->offset = 0; - retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4)); + retarray->base_addr = xmallocarray (rank, sizeof (index_type)); } else { @@ -199,7 +199,7 @@ mfindloc0_s4 (gfc_array_index_type * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype.rank = 1; retarray->offset = 0; - retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4)); + retarray->base_addr = xmallocarray (rank, sizeof (index_type)); } else { @@ -347,7 +347,7 @@ sfindloc0_s4 (gfc_array_index_type * const restrict retarray, index_type * restrict dest; index_type n; - if (*mask) + if (mask == NULL || *mask) { findloc0_s4 (retarray, array, value, back, len_array, len_value); return; @@ -363,7 +363,7 @@ sfindloc0_s4 (gfc_array_index_type * const restrict retarray, GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype.rank = 1; retarray->offset = 0; - retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4)); + retarray->base_addr = xmallocarray (rank, sizeof (index_type)); } else if (unlikely (compile_options.bounds_check)) { diff --git a/libgfortran/generated/findloc1_c16.c b/libgfortran/generated/findloc1_c16.c index 3c03c0b85ea..448994e77ce 100644 --- a/libgfortran/generated/findloc1_c16.c +++ b/libgfortran/generated/findloc1_c16.c @@ -103,7 +103,7 @@ findloc1_c16 (gfc_array_index_type * const restrict retarray, alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; - retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4)); + retarray->base_addr = xmallocarray (alloc_size, sizeof (index_type)); if (alloc_size == 0) { /* Make sure we have a zero-sized array. */ @@ -291,7 +291,7 @@ mfindloc1_c16 (gfc_array_index_type * const restrict retarray, alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; - retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4)); + retarray->base_addr = xmallocarray (alloc_size, sizeof (index_type)); if (alloc_size == 0) { /* Make sure we have a zero-sized array. */ @@ -407,7 +407,7 @@ sfindloc1_c16 (gfc_array_index_type * const restrict retarray, index_type dim; bool continue_loop; - if (*mask) + if (mask == NULL || *mask) { findloc1_c16 (retarray, array, value, pdim, back); return; @@ -464,7 +464,7 @@ sfindloc1_c16 (gfc_array_index_type * const restrict retarray, alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; - retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4)); + retarray->base_addr = xmallocarray (alloc_size, sizeof (index_type)); if (alloc_size == 0) { /* Make sure we have a zero-sized array. */ diff --git a/libgfortran/generated/findloc1_c4.c b/libgfortran/generated/findloc1_c4.c index 6355e2b356f..5f8828969e4 100644 --- a/libgfortran/generated/findloc1_c4.c +++ b/libgfortran/generated/findloc1_c4.c @@ -103,7 +103,7 @@ findloc1_c4 (gfc_array_index_type * const restrict retarray, alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; - retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4)); + retarray->base_addr = xmallocarray (alloc_size, sizeof (index_type)); if (alloc_size == 0) { /* Make sure we have a zero-sized array. */ @@ -291,7 +291,7 @@ mfindloc1_c4 (gfc_array_index_type * const restrict retarray, alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; - retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4)); + retarray->base_addr = xmallocarray (alloc_size, sizeof (index_type)); if (alloc_size == 0) { /* Make sure we have a zero-sized array. */ @@ -407,7 +407,7 @@ sfindloc1_c4 (gfc_array_index_type * const restrict retarray, index_type dim; bool continue_loop; - if (*mask) + if (mask == NULL || *mask) { findloc1_c4 (retarray, array, value, pdim, back); return; @@ -464,7 +464,7 @@ sfindloc1_c4 (gfc_array_index_type * const restrict retarray, alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; - retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4)); + retarray->base_addr = xmallocarray (alloc_size, sizeof (index_type)); if (alloc_size == 0) { /* Make sure we have a zero-sized array. */ diff --git a/libgfortran/generated/findloc1_c8.c b/libgfortran/generated/findloc1_c8.c index dec51727808..062eadf763d 100644 --- a/libgfortran/generated/findloc1_c8.c +++ b/libgfortran/generated/findloc1_c8.c @@ -103,7 +103,7 @@ findloc1_c8 (gfc_array_index_type * const restrict retarray, alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; - retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4)); + retarray->base_addr = xmallocarray (alloc_size, sizeof (index_type)); if (alloc_size == 0) { /* Make sure we have a zero-sized array. */ @@ -291,7 +291,7 @@ mfindloc1_c8 (gfc_array_index_type * const restrict retarray, alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; - retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4)); + retarray->base_addr = xmallocarray (alloc_size, sizeof (index_type)); if (alloc_size == 0) { /* Make sure we have a zero-sized array. */ @@ -407,7 +407,7 @@ sfindloc1_c8 (gfc_array_index_type * const restrict retarray, index_type dim; bool continue_loop; - if (*mask) + if (mask == NULL || *mask) { findloc1_c8 (retarray, array, value, pdim, back); return; @@ -464,7 +464,7 @@ sfindloc1_c8 (gfc_array_index_type * const restrict retarray, alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; - retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4)); + retarray->base_addr = xmallocarray (alloc_size, sizeof (index_type)); if (alloc_size == 0) { /* Make sure we have a zero-sized array. */ diff --git a/libgfortran/generated/findloc1_i1.c b/libgfortran/generated/findloc1_i1.c index 26b497e9aed..35c3d35fdf8 100644 --- a/libgfortran/generated/findloc1_i1.c +++ b/libgfortran/generated/findloc1_i1.c @@ -103,7 +103,7 @@ findloc1_i1 (gfc_array_index_type * const restrict retarray, alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; - retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4)); + retarray->base_addr = xmallocarray (alloc_size, sizeof (index_type)); if (alloc_size == 0) { /* Make sure we have a zero-sized array. */ @@ -291,7 +291,7 @@ mfindloc1_i1 (gfc_array_index_type * const restrict retarray, alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; - retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4)); + retarray->base_addr = xmallocarray (alloc_size, sizeof (index_type)); if (alloc_size == 0) { /* Make sure we have a zero-sized array. */ @@ -407,7 +407,7 @@ sfindloc1_i1 (gfc_array_index_type * const restrict retarray, index_type dim; bool continue_loop; - if (*mask) + if (mask == NULL || *mask) { findloc1_i1 (retarray, array, value, pdim, back); return; @@ -464,7 +464,7 @@ sfindloc1_i1 (gfc_array_index_type * const restrict retarray, alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; - retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4)); + retarray->base_addr = xmallocarray (alloc_size, sizeof (index_type)); if (alloc_size == 0) { /* Make sure we have a zero-sized array. */ diff --git a/libgfortran/generated/findloc1_i16.c b/libgfortran/generated/findloc1_i16.c index edb52e2e9ed..1e3ecd7fbac 100644 --- a/libgfortran/generated/findloc1_i16.c +++ b/libgfortran/generated/findloc1_i16.c @@ -103,7 +103,7 @@ findloc1_i16 (gfc_array_index_type * const restrict retarray, alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; - retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4)); + retarray->base_addr = xmallocarray (alloc_size, sizeof (index_type)); if (alloc_size == 0) { /* Make sure we have a zero-sized array. */ @@ -291,7 +291,7 @@ mfindloc1_i16 (gfc_array_index_type * const restrict retarray, alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; - retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4)); + retarray->base_addr = xmallocarray (alloc_size, sizeof (index_type)); if (alloc_size == 0) { /* Make sure we have a zero-sized array. */ @@ -407,7 +407,7 @@ sfindloc1_i16 (gfc_array_index_type * const restrict retarray, index_type dim; bool continue_loop; - if (*mask) + if (mask == NULL || *mask) { findloc1_i16 (retarray, array, value, pdim, back); return; @@ -464,7 +464,7 @@ sfindloc1_i16 (gfc_array_index_type * const restrict retarray, alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; - retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4)); + retarray->base_addr = xmallocarray (alloc_size, sizeof (index_type)); if (alloc_size == 0) { /* Make sure we have a zero-sized array. */ diff --git a/libgfortran/generated/findloc1_i2.c b/libgfortran/generated/findloc1_i2.c index 280b7b893a3..5ba8755f08d 100644 --- a/libgfortran/generated/findloc1_i2.c +++ b/libgfortran/generated/findloc1_i2.c @@ -103,7 +103,7 @@ findloc1_i2 (gfc_array_index_type * const restrict retarray, alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; - retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4)); + retarray->base_addr = xmallocarray (alloc_size, sizeof (index_type)); if (alloc_size == 0) { /* Make sure we have a zero-sized array. */ @@ -291,7 +291,7 @@ mfindloc1_i2 (gfc_array_index_type * const restrict retarray, alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; - retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4)); + retarray->base_addr = xmallocarray (alloc_size, sizeof (index_type)); if (alloc_size == 0) { /* Make sure we have a zero-sized array. */ @@ -407,7 +407,7 @@ sfindloc1_i2 (gfc_array_index_type * const restrict retarray, index_type dim; bool continue_loop; - if (*mask) + if (mask == NULL || *mask) { findloc1_i2 (retarray, array, value, pdim, back); return; @@ -464,7 +464,7 @@ sfindloc1_i2 (gfc_array_index_type * const restrict retarray, alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; - retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4)); + retarray->base_addr = xmallocarray (alloc_size, sizeof (index_type)); if (alloc_size == 0) { /* Make sure we have a zero-sized array. */ diff --git a/libgfortran/generated/findloc1_i4.c b/libgfortran/generated/findloc1_i4.c index a9e3abc21de..a62bb786e3b 100644 --- a/libgfortran/generated/findloc1_i4.c +++ b/libgfortran/generated/findloc1_i4.c @@ -103,7 +103,7 @@ findloc1_i4 (gfc_array_index_type * const restrict retarray, alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; - retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4)); + retarray->base_addr = xmallocarray (alloc_size, sizeof (index_type)); if (alloc_size == 0) { /* Make sure we have a zero-sized array. */ @@ -291,7 +291,7 @@ mfindloc1_i4 (gfc_array_index_type * const restrict retarray, alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; - retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4)); + retarray->base_addr = xmallocarray (alloc_size, sizeof (index_type)); if (alloc_size == 0) { /* Make sure we have a zero-sized array. */ @@ -407,7 +407,7 @@ sfindloc1_i4 (gfc_array_index_type * const restrict retarray, index_type dim; bool continue_loop; - if (*mask) + if (mask == NULL || *mask) { findloc1_i4 (retarray, array, value, pdim, back); return; @@ -464,7 +464,7 @@ sfindloc1_i4 (gfc_array_index_type * const restrict retarray, alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; - retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4)); + retarray->base_addr = xmallocarray (alloc_size, sizeof (index_type)); if (alloc_size == 0) { /* Make sure we have a zero-sized array. */ diff --git a/libgfortran/generated/findloc1_i8.c b/libgfortran/generated/findloc1_i8.c index 79b5a5a35e0..e25cb244258 100644 --- a/libgfortran/generated/findloc1_i8.c +++ b/libgfortran/generated/findloc1_i8.c @@ -103,7 +103,7 @@ findloc1_i8 (gfc_array_index_type * const restrict retarray, alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; - retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4)); + retarray->base_addr = xmallocarray (alloc_size, sizeof (index_type)); if (alloc_size == 0) { /* Make sure we have a zero-sized array. */ @@ -291,7 +291,7 @@ mfindloc1_i8 (gfc_array_index_type * const restrict retarray, alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; - retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4)); + retarray->base_addr = xmallocarray (alloc_size, sizeof (index_type)); if (alloc_size == 0) { /* Make sure we have a zero-sized array. */ @@ -407,7 +407,7 @@ sfindloc1_i8 (gfc_array_index_type * const restrict retarray, index_type dim; bool continue_loop; - if (*mask) + if (mask == NULL || *mask) { findloc1_i8 (retarray, array, value, pdim, back); return; @@ -464,7 +464,7 @@ sfindloc1_i8 (gfc_array_index_type * const restrict retarray, alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; - retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4)); + retarray->base_addr = xmallocarray (alloc_size, sizeof (index_type)); if (alloc_size == 0) { /* Make sure we have a zero-sized array. */ diff --git a/libgfortran/generated/findloc1_r16.c b/libgfortran/generated/findloc1_r16.c index 90f3db0ade6..7fe92d36662 100644 --- a/libgfortran/generated/findloc1_r16.c +++ b/libgfortran/generated/findloc1_r16.c @@ -103,7 +103,7 @@ findloc1_r16 (gfc_array_index_type * const restrict retarray, alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; - retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4)); + retarray->base_addr = xmallocarray (alloc_size, sizeof (index_type)); if (alloc_size == 0) { /* Make sure we have a zero-sized array. */ @@ -291,7 +291,7 @@ mfindloc1_r16 (gfc_array_index_type * const restrict retarray, alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; - retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4)); + retarray->base_addr = xmallocarray (alloc_size, sizeof (index_type)); if (alloc_size == 0) { /* Make sure we have a zero-sized array. */ @@ -407,7 +407,7 @@ sfindloc1_r16 (gfc_array_index_type * const restrict retarray, index_type dim; bool continue_loop; - if (*mask) + if (mask == NULL || *mask) { findloc1_r16 (retarray, array, value, pdim, back); return; @@ -464,7 +464,7 @@ sfindloc1_r16 (gfc_array_index_type * const restrict retarray, alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; - retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4)); + retarray->base_addr = xmallocarray (alloc_size, sizeof (index_type)); if (alloc_size == 0) { /* Make sure we have a zero-sized array. */ diff --git a/libgfortran/generated/findloc1_r4.c b/libgfortran/generated/findloc1_r4.c index d573cbb260d..29204a87ad2 100644 --- a/libgfortran/generated/findloc1_r4.c +++ b/libgfortran/generated/findloc1_r4.c @@ -103,7 +103,7 @@ findloc1_r4 (gfc_array_index_type * const restrict retarray, alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; - retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4)); + retarray->base_addr = xmallocarray (alloc_size, sizeof (index_type)); if (alloc_size == 0) { /* Make sure we have a zero-sized array. */ @@ -291,7 +291,7 @@ mfindloc1_r4 (gfc_array_index_type * const restrict retarray, alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; - retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4)); + retarray->base_addr = xmallocarray (alloc_size, sizeof (index_type)); if (alloc_size == 0) { /* Make sure we have a zero-sized array. */ @@ -407,7 +407,7 @@ sfindloc1_r4 (gfc_array_index_type * const restrict retarray, index_type dim; bool continue_loop; - if (*mask) + if (mask == NULL || *mask) { findloc1_r4 (retarray, array, value, pdim, back); return; @@ -464,7 +464,7 @@ sfindloc1_r4 (gfc_array_index_type * const restrict retarray, alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; - retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4)); + retarray->base_addr = xmallocarray (alloc_size, sizeof (index_type)); if (alloc_size == 0) { /* Make sure we have a zero-sized array. */ diff --git a/libgfortran/generated/findloc1_r8.c b/libgfortran/generated/findloc1_r8.c index 037993ce5aa..9c9c410a0aa 100644 --- a/libgfortran/generated/findloc1_r8.c +++ b/libgfortran/generated/findloc1_r8.c @@ -103,7 +103,7 @@ findloc1_r8 (gfc_array_index_type * const restrict retarray, alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; - retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4)); + retarray->base_addr = xmallocarray (alloc_size, sizeof (index_type)); if (alloc_size == 0) { /* Make sure we have a zero-sized array. */ @@ -291,7 +291,7 @@ mfindloc1_r8 (gfc_array_index_type * const restrict retarray, alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; - retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4)); + retarray->base_addr = xmallocarray (alloc_size, sizeof (index_type)); if (alloc_size == 0) { /* Make sure we have a zero-sized array. */ @@ -407,7 +407,7 @@ sfindloc1_r8 (gfc_array_index_type * const restrict retarray, index_type dim; bool continue_loop; - if (*mask) + if (mask == NULL || *mask) { findloc1_r8 (retarray, array, value, pdim, back); return; @@ -464,7 +464,7 @@ sfindloc1_r8 (gfc_array_index_type * const restrict retarray, alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; - retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4)); + retarray->base_addr = xmallocarray (alloc_size, sizeof (index_type)); if (alloc_size == 0) { /* Make sure we have a zero-sized array. */ diff --git a/libgfortran/generated/findloc1_s1.c b/libgfortran/generated/findloc1_s1.c index 0b331acc140..f9a065b35cf 100644 --- a/libgfortran/generated/findloc1_s1.c +++ b/libgfortran/generated/findloc1_s1.c @@ -105,7 +105,7 @@ findloc1_s1 (gfc_array_index_type * const restrict retarray, alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; - retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4)); + retarray->base_addr = xmallocarray (alloc_size, sizeof (index_type)); if (alloc_size == 0) { /* Make sure we have a zero-sized array. */ @@ -293,7 +293,7 @@ mfindloc1_s1 (gfc_array_index_type * const restrict retarray, alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; - retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4)); + retarray->base_addr = xmallocarray (alloc_size, sizeof (index_type)); if (alloc_size == 0) { /* Make sure we have a zero-sized array. */ @@ -409,7 +409,7 @@ sfindloc1_s1 (gfc_array_index_type * const restrict retarray, index_type dim; bool continue_loop; - if (*mask) + if (mask == NULL || *mask) { findloc1_s1 (retarray, array, value, pdim, back, len_array, len_value); return; @@ -466,7 +466,7 @@ sfindloc1_s1 (gfc_array_index_type * const restrict retarray, alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; - retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4)); + retarray->base_addr = xmallocarray (alloc_size, sizeof (index_type)); if (alloc_size == 0) { /* Make sure we have a zero-sized array. */ diff --git a/libgfortran/generated/findloc1_s4.c b/libgfortran/generated/findloc1_s4.c index 6b42d10ee8e..1487d581567 100644 --- a/libgfortran/generated/findloc1_s4.c +++ b/libgfortran/generated/findloc1_s4.c @@ -105,7 +105,7 @@ findloc1_s4 (gfc_array_index_type * const restrict retarray, alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; - retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4)); + retarray->base_addr = xmallocarray (alloc_size, sizeof (index_type)); if (alloc_size == 0) { /* Make sure we have a zero-sized array. */ @@ -293,7 +293,7 @@ mfindloc1_s4 (gfc_array_index_type * const restrict retarray, alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; - retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4)); + retarray->base_addr = xmallocarray (alloc_size, sizeof (index_type)); if (alloc_size == 0) { /* Make sure we have a zero-sized array. */ @@ -409,7 +409,7 @@ sfindloc1_s4 (gfc_array_index_type * const restrict retarray, index_type dim; bool continue_loop; - if (*mask) + if (mask == NULL || *mask) { findloc1_s4 (retarray, array, value, pdim, back, len_array, len_value); return; @@ -466,7 +466,7 @@ sfindloc1_s4 (gfc_array_index_type * const restrict retarray, alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; - retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4)); + retarray->base_addr = xmallocarray (alloc_size, sizeof (index_type)); if (alloc_size == 0) { /* Make sure we have a zero-sized array. */ diff --git a/libgfortran/generated/findloc2_s1.c b/libgfortran/generated/findloc2_s1.c index bfeca024b45..9b894a85895 100644 --- a/libgfortran/generated/findloc2_s1.c +++ b/libgfortran/generated/findloc2_s1.c @@ -145,7 +145,7 @@ sfindloc2_s1 (gfc_array_s1 * const restrict array, GFC_LOGICAL_4 back, gfc_charlen_type len_array, gfc_charlen_type len_value) { - if (*mask) + if (mask == NULL || *mask) { return findloc2_s1 (array, value, back, len_array, len_value); } diff --git a/libgfortran/generated/findloc2_s4.c b/libgfortran/generated/findloc2_s4.c index 6597b5670fa..7042df5dfb3 100644 --- a/libgfortran/generated/findloc2_s4.c +++ b/libgfortran/generated/findloc2_s4.c @@ -145,7 +145,7 @@ sfindloc2_s4 (gfc_array_s4 * const restrict array, GFC_LOGICAL_4 back, gfc_charlen_type len_array, gfc_charlen_type len_value) { - if (*mask) + if (mask == NULL || *mask) { return findloc2_s4 (array, value, back, len_array, len_value); } diff --git a/libgfortran/generated/iall_i1.c b/libgfortran/generated/iall_i1.c index 481b2b0b2f7..90e9e8cbd40 100644 --- a/libgfortran/generated/iall_i1.c +++ b/libgfortran/generated/iall_i1.c @@ -220,6 +220,16 @@ miall_i1 (gfc_array_i1 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + iall_i1 (retarray, array, pdim, back); +#else + iall_i1 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -399,7 +409,7 @@ siall_i1 (gfc_array_i1 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG iall_i1 (retarray, array, pdim, back); diff --git a/libgfortran/generated/iall_i16.c b/libgfortran/generated/iall_i16.c index 51e38a53725..b87109e93af 100644 --- a/libgfortran/generated/iall_i16.c +++ b/libgfortran/generated/iall_i16.c @@ -220,6 +220,16 @@ miall_i16 (gfc_array_i16 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + iall_i16 (retarray, array, pdim, back); +#else + iall_i16 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -399,7 +409,7 @@ siall_i16 (gfc_array_i16 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG iall_i16 (retarray, array, pdim, back); diff --git a/libgfortran/generated/iall_i2.c b/libgfortran/generated/iall_i2.c index 32300e32dab..7ac579a1110 100644 --- a/libgfortran/generated/iall_i2.c +++ b/libgfortran/generated/iall_i2.c @@ -220,6 +220,16 @@ miall_i2 (gfc_array_i2 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + iall_i2 (retarray, array, pdim, back); +#else + iall_i2 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -399,7 +409,7 @@ siall_i2 (gfc_array_i2 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG iall_i2 (retarray, array, pdim, back); diff --git a/libgfortran/generated/iall_i4.c b/libgfortran/generated/iall_i4.c index 8083c5a0fab..0ffe50aea9c 100644 --- a/libgfortran/generated/iall_i4.c +++ b/libgfortran/generated/iall_i4.c @@ -220,6 +220,16 @@ miall_i4 (gfc_array_i4 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + iall_i4 (retarray, array, pdim, back); +#else + iall_i4 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -399,7 +409,7 @@ siall_i4 (gfc_array_i4 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG iall_i4 (retarray, array, pdim, back); diff --git a/libgfortran/generated/iall_i8.c b/libgfortran/generated/iall_i8.c index a337cdbab18..c9d6688ad84 100644 --- a/libgfortran/generated/iall_i8.c +++ b/libgfortran/generated/iall_i8.c @@ -220,6 +220,16 @@ miall_i8 (gfc_array_i8 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + iall_i8 (retarray, array, pdim, back); +#else + iall_i8 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -399,7 +409,7 @@ siall_i8 (gfc_array_i8 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG iall_i8 (retarray, array, pdim, back); diff --git a/libgfortran/generated/iany_i1.c b/libgfortran/generated/iany_i1.c index 063d4b21b6e..bbc69543553 100644 --- a/libgfortran/generated/iany_i1.c +++ b/libgfortran/generated/iany_i1.c @@ -220,6 +220,16 @@ miany_i1 (gfc_array_i1 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + iany_i1 (retarray, array, pdim, back); +#else + iany_i1 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -399,7 +409,7 @@ siany_i1 (gfc_array_i1 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG iany_i1 (retarray, array, pdim, back); diff --git a/libgfortran/generated/iany_i16.c b/libgfortran/generated/iany_i16.c index bac35d0af0f..f3604825e9a 100644 --- a/libgfortran/generated/iany_i16.c +++ b/libgfortran/generated/iany_i16.c @@ -220,6 +220,16 @@ miany_i16 (gfc_array_i16 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + iany_i16 (retarray, array, pdim, back); +#else + iany_i16 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -399,7 +409,7 @@ siany_i16 (gfc_array_i16 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG iany_i16 (retarray, array, pdim, back); diff --git a/libgfortran/generated/iany_i2.c b/libgfortran/generated/iany_i2.c index ea1ae236058..5c462cd25e0 100644 --- a/libgfortran/generated/iany_i2.c +++ b/libgfortran/generated/iany_i2.c @@ -220,6 +220,16 @@ miany_i2 (gfc_array_i2 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + iany_i2 (retarray, array, pdim, back); +#else + iany_i2 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -399,7 +409,7 @@ siany_i2 (gfc_array_i2 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG iany_i2 (retarray, array, pdim, back); diff --git a/libgfortran/generated/iany_i4.c b/libgfortran/generated/iany_i4.c index 9d9d4af6627..c0eff89fc14 100644 --- a/libgfortran/generated/iany_i4.c +++ b/libgfortran/generated/iany_i4.c @@ -220,6 +220,16 @@ miany_i4 (gfc_array_i4 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + iany_i4 (retarray, array, pdim, back); +#else + iany_i4 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -399,7 +409,7 @@ siany_i4 (gfc_array_i4 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG iany_i4 (retarray, array, pdim, back); diff --git a/libgfortran/generated/iany_i8.c b/libgfortran/generated/iany_i8.c index e3f30816daa..6b8956d873e 100644 --- a/libgfortran/generated/iany_i8.c +++ b/libgfortran/generated/iany_i8.c @@ -220,6 +220,16 @@ miany_i8 (gfc_array_i8 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + iany_i8 (retarray, array, pdim, back); +#else + iany_i8 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -399,7 +409,7 @@ siany_i8 (gfc_array_i8 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG iany_i8 (retarray, array, pdim, back); diff --git a/libgfortran/generated/iparity_i1.c b/libgfortran/generated/iparity_i1.c index cdcae29aae9..75db3e6d64b 100644 --- a/libgfortran/generated/iparity_i1.c +++ b/libgfortran/generated/iparity_i1.c @@ -220,6 +220,16 @@ miparity_i1 (gfc_array_i1 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + iparity_i1 (retarray, array, pdim, back); +#else + iparity_i1 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -399,7 +409,7 @@ siparity_i1 (gfc_array_i1 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG iparity_i1 (retarray, array, pdim, back); diff --git a/libgfortran/generated/iparity_i16.c b/libgfortran/generated/iparity_i16.c index 7705648aa5f..70593f6a8cc 100644 --- a/libgfortran/generated/iparity_i16.c +++ b/libgfortran/generated/iparity_i16.c @@ -220,6 +220,16 @@ miparity_i16 (gfc_array_i16 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + iparity_i16 (retarray, array, pdim, back); +#else + iparity_i16 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -399,7 +409,7 @@ siparity_i16 (gfc_array_i16 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG iparity_i16 (retarray, array, pdim, back); diff --git a/libgfortran/generated/iparity_i2.c b/libgfortran/generated/iparity_i2.c index 87422a7af84..3fd08846309 100644 --- a/libgfortran/generated/iparity_i2.c +++ b/libgfortran/generated/iparity_i2.c @@ -220,6 +220,16 @@ miparity_i2 (gfc_array_i2 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + iparity_i2 (retarray, array, pdim, back); +#else + iparity_i2 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -399,7 +409,7 @@ siparity_i2 (gfc_array_i2 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG iparity_i2 (retarray, array, pdim, back); diff --git a/libgfortran/generated/iparity_i4.c b/libgfortran/generated/iparity_i4.c index a4384e1b9de..0ce622b5ece 100644 --- a/libgfortran/generated/iparity_i4.c +++ b/libgfortran/generated/iparity_i4.c @@ -220,6 +220,16 @@ miparity_i4 (gfc_array_i4 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + iparity_i4 (retarray, array, pdim, back); +#else + iparity_i4 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -399,7 +409,7 @@ siparity_i4 (gfc_array_i4 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG iparity_i4 (retarray, array, pdim, back); diff --git a/libgfortran/generated/iparity_i8.c b/libgfortran/generated/iparity_i8.c index 2321bc3d3d5..7511fa3dacf 100644 --- a/libgfortran/generated/iparity_i8.c +++ b/libgfortran/generated/iparity_i8.c @@ -220,6 +220,16 @@ miparity_i8 (gfc_array_i8 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + iparity_i8 (retarray, array, pdim, back); +#else + iparity_i8 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -399,7 +409,7 @@ siparity_i8 (gfc_array_i8 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG iparity_i8 (retarray, array, pdim, back); diff --git a/libgfortran/generated/maxloc0_16_i1.c b/libgfortran/generated/maxloc0_16_i1.c index ac09f143541..f67c478ee4b 100644 --- a/libgfortran/generated/maxloc0_16_i1.c +++ b/libgfortran/generated/maxloc0_16_i1.c @@ -198,6 +198,13 @@ mmaxloc0_16_i1 (gfc_array_i16 * const restrict retarray, index_type n; int mask_kind; + + if (mask == NULL) + { + maxloc0_16_i1 (retarray, array, back); + return; + } + rank = GFC_DESCRIPTOR_RANK (array); if (rank <= 0) runtime_error ("Rank of array needs to be > 0"); @@ -369,7 +376,7 @@ smaxloc0_16_i1 (gfc_array_i16 * const restrict retarray, index_type n; GFC_INTEGER_16 *dest; - if (*mask) + if (mask == NULL || *mask) { maxloc0_16_i1 (retarray, array, back); return; diff --git a/libgfortran/generated/maxloc0_16_i16.c b/libgfortran/generated/maxloc0_16_i16.c index f3cfd9deb92..8de56ac65d0 100644 --- a/libgfortran/generated/maxloc0_16_i16.c +++ b/libgfortran/generated/maxloc0_16_i16.c @@ -198,6 +198,13 @@ mmaxloc0_16_i16 (gfc_array_i16 * const restrict retarray, index_type n; int mask_kind; + + if (mask == NULL) + { + maxloc0_16_i16 (retarray, array, back); + return; + } + rank = GFC_DESCRIPTOR_RANK (array); if (rank <= 0) runtime_error ("Rank of array needs to be > 0"); @@ -369,7 +376,7 @@ smaxloc0_16_i16 (gfc_array_i16 * const restrict retarray, index_type n; GFC_INTEGER_16 *dest; - if (*mask) + if (mask == NULL || *mask) { maxloc0_16_i16 (retarray, array, back); return; diff --git a/libgfortran/generated/maxloc0_16_i2.c b/libgfortran/generated/maxloc0_16_i2.c index f90744a2bb9..a084a8d71fb 100644 --- a/libgfortran/generated/maxloc0_16_i2.c +++ b/libgfortran/generated/maxloc0_16_i2.c @@ -198,6 +198,13 @@ mmaxloc0_16_i2 (gfc_array_i16 * const restrict retarray, index_type n; int mask_kind; + + if (mask == NULL) + { + maxloc0_16_i2 (retarray, array, back); + return; + } + rank = GFC_DESCRIPTOR_RANK (array); if (rank <= 0) runtime_error ("Rank of array needs to be > 0"); @@ -369,7 +376,7 @@ smaxloc0_16_i2 (gfc_array_i16 * const restrict retarray, index_type n; GFC_INTEGER_16 *dest; - if (*mask) + if (mask == NULL || *mask) { maxloc0_16_i2 (retarray, array, back); return; diff --git a/libgfortran/generated/maxloc0_16_i4.c b/libgfortran/generated/maxloc0_16_i4.c index 39491036fd3..730dc7bc350 100644 --- a/libgfortran/generated/maxloc0_16_i4.c +++ b/libgfortran/generated/maxloc0_16_i4.c @@ -198,6 +198,13 @@ mmaxloc0_16_i4 (gfc_array_i16 * const restrict retarray, index_type n; int mask_kind; + + if (mask == NULL) + { + maxloc0_16_i4 (retarray, array, back); + return; + } + rank = GFC_DESCRIPTOR_RANK (array); if (rank <= 0) runtime_error ("Rank of array needs to be > 0"); @@ -369,7 +376,7 @@ smaxloc0_16_i4 (gfc_array_i16 * const restrict retarray, index_type n; GFC_INTEGER_16 *dest; - if (*mask) + if (mask == NULL || *mask) { maxloc0_16_i4 (retarray, array, back); return; diff --git a/libgfortran/generated/maxloc0_16_i8.c b/libgfortran/generated/maxloc0_16_i8.c index 5a569e8a226..5cdeae5dcb0 100644 --- a/libgfortran/generated/maxloc0_16_i8.c +++ b/libgfortran/generated/maxloc0_16_i8.c @@ -198,6 +198,13 @@ mmaxloc0_16_i8 (gfc_array_i16 * const restrict retarray, index_type n; int mask_kind; + + if (mask == NULL) + { + maxloc0_16_i8 (retarray, array, back); + return; + } + rank = GFC_DESCRIPTOR_RANK (array); if (rank <= 0) runtime_error ("Rank of array needs to be > 0"); @@ -369,7 +376,7 @@ smaxloc0_16_i8 (gfc_array_i16 * const restrict retarray, index_type n; GFC_INTEGER_16 *dest; - if (*mask) + if (mask == NULL || *mask) { maxloc0_16_i8 (retarray, array, back); return; diff --git a/libgfortran/generated/maxloc0_16_r10.c b/libgfortran/generated/maxloc0_16_r10.c index f8dc7370055..4804599366b 100644 --- a/libgfortran/generated/maxloc0_16_r10.c +++ b/libgfortran/generated/maxloc0_16_r10.c @@ -198,6 +198,13 @@ mmaxloc0_16_r10 (gfc_array_i16 * const restrict retarray, index_type n; int mask_kind; + + if (mask == NULL) + { + maxloc0_16_r10 (retarray, array, back); + return; + } + rank = GFC_DESCRIPTOR_RANK (array); if (rank <= 0) runtime_error ("Rank of array needs to be > 0"); @@ -369,7 +376,7 @@ smaxloc0_16_r10 (gfc_array_i16 * const restrict retarray, index_type n; GFC_INTEGER_16 *dest; - if (*mask) + if (mask == NULL || *mask) { maxloc0_16_r10 (retarray, array, back); return; diff --git a/libgfortran/generated/maxloc0_16_r16.c b/libgfortran/generated/maxloc0_16_r16.c index 8c78a6d7bb6..2e94aca0a67 100644 --- a/libgfortran/generated/maxloc0_16_r16.c +++ b/libgfortran/generated/maxloc0_16_r16.c @@ -198,6 +198,13 @@ mmaxloc0_16_r16 (gfc_array_i16 * const restrict retarray, index_type n; int mask_kind; + + if (mask == NULL) + { + maxloc0_16_r16 (retarray, array, back); + return; + } + rank = GFC_DESCRIPTOR_RANK (array); if (rank <= 0) runtime_error ("Rank of array needs to be > 0"); @@ -369,7 +376,7 @@ smaxloc0_16_r16 (gfc_array_i16 * const restrict retarray, index_type n; GFC_INTEGER_16 *dest; - if (*mask) + if (mask == NULL || *mask) { maxloc0_16_r16 (retarray, array, back); return; diff --git a/libgfortran/generated/maxloc0_16_r4.c b/libgfortran/generated/maxloc0_16_r4.c index 961f39c6c19..e4ecabbde32 100644 --- a/libgfortran/generated/maxloc0_16_r4.c +++ b/libgfortran/generated/maxloc0_16_r4.c @@ -198,6 +198,13 @@ mmaxloc0_16_r4 (gfc_array_i16 * const restrict retarray, index_type n; int mask_kind; + + if (mask == NULL) + { + maxloc0_16_r4 (retarray, array, back); + return; + } + rank = GFC_DESCRIPTOR_RANK (array); if (rank <= 0) runtime_error ("Rank of array needs to be > 0"); @@ -369,7 +376,7 @@ smaxloc0_16_r4 (gfc_array_i16 * const restrict retarray, index_type n; GFC_INTEGER_16 *dest; - if (*mask) + if (mask == NULL || *mask) { maxloc0_16_r4 (retarray, array, back); return; diff --git a/libgfortran/generated/maxloc0_16_r8.c b/libgfortran/generated/maxloc0_16_r8.c index c5414b4b117..1faa4bbcf0b 100644 --- a/libgfortran/generated/maxloc0_16_r8.c +++ b/libgfortran/generated/maxloc0_16_r8.c @@ -198,6 +198,13 @@ mmaxloc0_16_r8 (gfc_array_i16 * const restrict retarray, index_type n; int mask_kind; + + if (mask == NULL) + { + maxloc0_16_r8 (retarray, array, back); + return; + } + rank = GFC_DESCRIPTOR_RANK (array); if (rank <= 0) runtime_error ("Rank of array needs to be > 0"); @@ -369,7 +376,7 @@ smaxloc0_16_r8 (gfc_array_i16 * const restrict retarray, index_type n; GFC_INTEGER_16 *dest; - if (*mask) + if (mask == NULL || *mask) { maxloc0_16_r8 (retarray, array, back); return; diff --git a/libgfortran/generated/maxloc0_16_s1.c b/libgfortran/generated/maxloc0_16_s1.c index cfe35688302..ee2a8b7666f 100644 --- a/libgfortran/generated/maxloc0_16_s1.c +++ b/libgfortran/generated/maxloc0_16_s1.c @@ -174,6 +174,16 @@ mmaxloc0_16_s1 (gfc_array_i16 * const restrict retarray, index_type n; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + maxloc0_16_s1 (retarray, array, back, len); +#else + maxloc0_16_s1 (retarray, array, len); +#endif + return; + } + rank = GFC_DESCRIPTOR_RANK (array); if (rank <= 0) runtime_error ("Rank of array needs to be > 0"); @@ -304,7 +314,7 @@ smaxloc0_16_s1 (gfc_array_i16 * const restrict retarray, index_type n; GFC_INTEGER_16 *dest; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG maxloc0_16_s1 (retarray, array, back, len); diff --git a/libgfortran/generated/maxloc0_16_s4.c b/libgfortran/generated/maxloc0_16_s4.c index dc16503aec0..b26fb68c3e0 100644 --- a/libgfortran/generated/maxloc0_16_s4.c +++ b/libgfortran/generated/maxloc0_16_s4.c @@ -174,6 +174,16 @@ mmaxloc0_16_s4 (gfc_array_i16 * const restrict retarray, index_type n; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + maxloc0_16_s4 (retarray, array, back, len); +#else + maxloc0_16_s4 (retarray, array, len); +#endif + return; + } + rank = GFC_DESCRIPTOR_RANK (array); if (rank <= 0) runtime_error ("Rank of array needs to be > 0"); @@ -304,7 +314,7 @@ smaxloc0_16_s4 (gfc_array_i16 * const restrict retarray, index_type n; GFC_INTEGER_16 *dest; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG maxloc0_16_s4 (retarray, array, back, len); diff --git a/libgfortran/generated/maxloc0_4_i1.c b/libgfortran/generated/maxloc0_4_i1.c index 014bcb14d0c..2976ee854ae 100644 --- a/libgfortran/generated/maxloc0_4_i1.c +++ b/libgfortran/generated/maxloc0_4_i1.c @@ -198,6 +198,13 @@ mmaxloc0_4_i1 (gfc_array_i4 * const restrict retarray, index_type n; int mask_kind; + + if (mask == NULL) + { + maxloc0_4_i1 (retarray, array, back); + return; + } + rank = GFC_DESCRIPTOR_RANK (array); if (rank <= 0) runtime_error ("Rank of array needs to be > 0"); @@ -369,7 +376,7 @@ smaxloc0_4_i1 (gfc_array_i4 * const restrict retarray, index_type n; GFC_INTEGER_4 *dest; - if (*mask) + if (mask == NULL || *mask) { maxloc0_4_i1 (retarray, array, back); return; diff --git a/libgfortran/generated/maxloc0_4_i16.c b/libgfortran/generated/maxloc0_4_i16.c index 42262d2e72d..00e6beda7ae 100644 --- a/libgfortran/generated/maxloc0_4_i16.c +++ b/libgfortran/generated/maxloc0_4_i16.c @@ -198,6 +198,13 @@ mmaxloc0_4_i16 (gfc_array_i4 * const restrict retarray, index_type n; int mask_kind; + + if (mask == NULL) + { + maxloc0_4_i16 (retarray, array, back); + return; + } + rank = GFC_DESCRIPTOR_RANK (array); if (rank <= 0) runtime_error ("Rank of array needs to be > 0"); @@ -369,7 +376,7 @@ smaxloc0_4_i16 (gfc_array_i4 * const restrict retarray, index_type n; GFC_INTEGER_4 *dest; - if (*mask) + if (mask == NULL || *mask) { maxloc0_4_i16 (retarray, array, back); return; diff --git a/libgfortran/generated/maxloc0_4_i2.c b/libgfortran/generated/maxloc0_4_i2.c index dd9e6783558..1c973a07d88 100644 --- a/libgfortran/generated/maxloc0_4_i2.c +++ b/libgfortran/generated/maxloc0_4_i2.c @@ -198,6 +198,13 @@ mmaxloc0_4_i2 (gfc_array_i4 * const restrict retarray, index_type n; int mask_kind; + + if (mask == NULL) + { + maxloc0_4_i2 (retarray, array, back); + return; + } + rank = GFC_DESCRIPTOR_RANK (array); if (rank <= 0) runtime_error ("Rank of array needs to be > 0"); @@ -369,7 +376,7 @@ smaxloc0_4_i2 (gfc_array_i4 * const restrict retarray, index_type n; GFC_INTEGER_4 *dest; - if (*mask) + if (mask == NULL || *mask) { maxloc0_4_i2 (retarray, array, back); return; diff --git a/libgfortran/generated/maxloc0_4_i4.c b/libgfortran/generated/maxloc0_4_i4.c index ca389b8d076..3c704dad1bc 100644 --- a/libgfortran/generated/maxloc0_4_i4.c +++ b/libgfortran/generated/maxloc0_4_i4.c @@ -198,6 +198,13 @@ mmaxloc0_4_i4 (gfc_array_i4 * const restrict retarray, index_type n; int mask_kind; + + if (mask == NULL) + { + maxloc0_4_i4 (retarray, array, back); + return; + } + rank = GFC_DESCRIPTOR_RANK (array); if (rank <= 0) runtime_error ("Rank of array needs to be > 0"); @@ -369,7 +376,7 @@ smaxloc0_4_i4 (gfc_array_i4 * const restrict retarray, index_type n; GFC_INTEGER_4 *dest; - if (*mask) + if (mask == NULL || *mask) { maxloc0_4_i4 (retarray, array, back); return; diff --git a/libgfortran/generated/maxloc0_4_i8.c b/libgfortran/generated/maxloc0_4_i8.c index 1d24756e6f7..a755d7ad78a 100644 --- a/libgfortran/generated/maxloc0_4_i8.c +++ b/libgfortran/generated/maxloc0_4_i8.c @@ -198,6 +198,13 @@ mmaxloc0_4_i8 (gfc_array_i4 * const restrict retarray, index_type n; int mask_kind; + + if (mask == NULL) + { + maxloc0_4_i8 (retarray, array, back); + return; + } + rank = GFC_DESCRIPTOR_RANK (array); if (rank <= 0) runtime_error ("Rank of array needs to be > 0"); @@ -369,7 +376,7 @@ smaxloc0_4_i8 (gfc_array_i4 * const restrict retarray, index_type n; GFC_INTEGER_4 *dest; - if (*mask) + if (mask == NULL || *mask) { maxloc0_4_i8 (retarray, array, back); return; diff --git a/libgfortran/generated/maxloc0_4_r10.c b/libgfortran/generated/maxloc0_4_r10.c index 1008bdf3acf..c50d0f63be8 100644 --- a/libgfortran/generated/maxloc0_4_r10.c +++ b/libgfortran/generated/maxloc0_4_r10.c @@ -198,6 +198,13 @@ mmaxloc0_4_r10 (gfc_array_i4 * const restrict retarray, index_type n; int mask_kind; + + if (mask == NULL) + { + maxloc0_4_r10 (retarray, array, back); + return; + } + rank = GFC_DESCRIPTOR_RANK (array); if (rank <= 0) runtime_error ("Rank of array needs to be > 0"); @@ -369,7 +376,7 @@ smaxloc0_4_r10 (gfc_array_i4 * const restrict retarray, index_type n; GFC_INTEGER_4 *dest; - if (*mask) + if (mask == NULL || *mask) { maxloc0_4_r10 (retarray, array, back); return; diff --git a/libgfortran/generated/maxloc0_4_r16.c b/libgfortran/generated/maxloc0_4_r16.c index 781bf84ce95..d990e7730bd 100644 --- a/libgfortran/generated/maxloc0_4_r16.c +++ b/libgfortran/generated/maxloc0_4_r16.c @@ -198,6 +198,13 @@ mmaxloc0_4_r16 (gfc_array_i4 * const restrict retarray, index_type n; int mask_kind; + + if (mask == NULL) + { + maxloc0_4_r16 (retarray, array, back); + return; + } + rank = GFC_DESCRIPTOR_RANK (array); if (rank <= 0) runtime_error ("Rank of array needs to be > 0"); @@ -369,7 +376,7 @@ smaxloc0_4_r16 (gfc_array_i4 * const restrict retarray, index_type n; GFC_INTEGER_4 *dest; - if (*mask) + if (mask == NULL || *mask) { maxloc0_4_r16 (retarray, array, back); return; diff --git a/libgfortran/generated/maxloc0_4_r4.c b/libgfortran/generated/maxloc0_4_r4.c index c2796c6a6ee..cfc3a879596 100644 --- a/libgfortran/generated/maxloc0_4_r4.c +++ b/libgfortran/generated/maxloc0_4_r4.c @@ -198,6 +198,13 @@ mmaxloc0_4_r4 (gfc_array_i4 * const restrict retarray, index_type n; int mask_kind; + + if (mask == NULL) + { + maxloc0_4_r4 (retarray, array, back); + return; + } + rank = GFC_DESCRIPTOR_RANK (array); if (rank <= 0) runtime_error ("Rank of array needs to be > 0"); @@ -369,7 +376,7 @@ smaxloc0_4_r4 (gfc_array_i4 * const restrict retarray, index_type n; GFC_INTEGER_4 *dest; - if (*mask) + if (mask == NULL || *mask) { maxloc0_4_r4 (retarray, array, back); return; diff --git a/libgfortran/generated/maxloc0_4_r8.c b/libgfortran/generated/maxloc0_4_r8.c index 38f3f6ffbb3..6d6fe5a95b6 100644 --- a/libgfortran/generated/maxloc0_4_r8.c +++ b/libgfortran/generated/maxloc0_4_r8.c @@ -198,6 +198,13 @@ mmaxloc0_4_r8 (gfc_array_i4 * const restrict retarray, index_type n; int mask_kind; + + if (mask == NULL) + { + maxloc0_4_r8 (retarray, array, back); + return; + } + rank = GFC_DESCRIPTOR_RANK (array); if (rank <= 0) runtime_error ("Rank of array needs to be > 0"); @@ -369,7 +376,7 @@ smaxloc0_4_r8 (gfc_array_i4 * const restrict retarray, index_type n; GFC_INTEGER_4 *dest; - if (*mask) + if (mask == NULL || *mask) { maxloc0_4_r8 (retarray, array, back); return; diff --git a/libgfortran/generated/maxloc0_4_s1.c b/libgfortran/generated/maxloc0_4_s1.c index 094a5b44b10..8533614dc10 100644 --- a/libgfortran/generated/maxloc0_4_s1.c +++ b/libgfortran/generated/maxloc0_4_s1.c @@ -174,6 +174,16 @@ mmaxloc0_4_s1 (gfc_array_i4 * const restrict retarray, index_type n; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + maxloc0_4_s1 (retarray, array, back, len); +#else + maxloc0_4_s1 (retarray, array, len); +#endif + return; + } + rank = GFC_DESCRIPTOR_RANK (array); if (rank <= 0) runtime_error ("Rank of array needs to be > 0"); @@ -304,7 +314,7 @@ smaxloc0_4_s1 (gfc_array_i4 * const restrict retarray, index_type n; GFC_INTEGER_4 *dest; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG maxloc0_4_s1 (retarray, array, back, len); diff --git a/libgfortran/generated/maxloc0_4_s4.c b/libgfortran/generated/maxloc0_4_s4.c index b751faa4ec9..22d58ff5791 100644 --- a/libgfortran/generated/maxloc0_4_s4.c +++ b/libgfortran/generated/maxloc0_4_s4.c @@ -174,6 +174,16 @@ mmaxloc0_4_s4 (gfc_array_i4 * const restrict retarray, index_type n; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + maxloc0_4_s4 (retarray, array, back, len); +#else + maxloc0_4_s4 (retarray, array, len); +#endif + return; + } + rank = GFC_DESCRIPTOR_RANK (array); if (rank <= 0) runtime_error ("Rank of array needs to be > 0"); @@ -304,7 +314,7 @@ smaxloc0_4_s4 (gfc_array_i4 * const restrict retarray, index_type n; GFC_INTEGER_4 *dest; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG maxloc0_4_s4 (retarray, array, back, len); diff --git a/libgfortran/generated/maxloc0_8_i1.c b/libgfortran/generated/maxloc0_8_i1.c index a2ec27fb410..509b7f86a9d 100644 --- a/libgfortran/generated/maxloc0_8_i1.c +++ b/libgfortran/generated/maxloc0_8_i1.c @@ -198,6 +198,13 @@ mmaxloc0_8_i1 (gfc_array_i8 * const restrict retarray, index_type n; int mask_kind; + + if (mask == NULL) + { + maxloc0_8_i1 (retarray, array, back); + return; + } + rank = GFC_DESCRIPTOR_RANK (array); if (rank <= 0) runtime_error ("Rank of array needs to be > 0"); @@ -369,7 +376,7 @@ smaxloc0_8_i1 (gfc_array_i8 * const restrict retarray, index_type n; GFC_INTEGER_8 *dest; - if (*mask) + if (mask == NULL || *mask) { maxloc0_8_i1 (retarray, array, back); return; diff --git a/libgfortran/generated/maxloc0_8_i16.c b/libgfortran/generated/maxloc0_8_i16.c index 30a12d1a87f..c23d40cf456 100644 --- a/libgfortran/generated/maxloc0_8_i16.c +++ b/libgfortran/generated/maxloc0_8_i16.c @@ -198,6 +198,13 @@ mmaxloc0_8_i16 (gfc_array_i8 * const restrict retarray, index_type n; int mask_kind; + + if (mask == NULL) + { + maxloc0_8_i16 (retarray, array, back); + return; + } + rank = GFC_DESCRIPTOR_RANK (array); if (rank <= 0) runtime_error ("Rank of array needs to be > 0"); @@ -369,7 +376,7 @@ smaxloc0_8_i16 (gfc_array_i8 * const restrict retarray, index_type n; GFC_INTEGER_8 *dest; - if (*mask) + if (mask == NULL || *mask) { maxloc0_8_i16 (retarray, array, back); return; diff --git a/libgfortran/generated/maxloc0_8_i2.c b/libgfortran/generated/maxloc0_8_i2.c index 6592aec9832..3335c155552 100644 --- a/libgfortran/generated/maxloc0_8_i2.c +++ b/libgfortran/generated/maxloc0_8_i2.c @@ -198,6 +198,13 @@ mmaxloc0_8_i2 (gfc_array_i8 * const restrict retarray, index_type n; int mask_kind; + + if (mask == NULL) + { + maxloc0_8_i2 (retarray, array, back); + return; + } + rank = GFC_DESCRIPTOR_RANK (array); if (rank <= 0) runtime_error ("Rank of array needs to be > 0"); @@ -369,7 +376,7 @@ smaxloc0_8_i2 (gfc_array_i8 * const restrict retarray, index_type n; GFC_INTEGER_8 *dest; - if (*mask) + if (mask == NULL || *mask) { maxloc0_8_i2 (retarray, array, back); return; diff --git a/libgfortran/generated/maxloc0_8_i4.c b/libgfortran/generated/maxloc0_8_i4.c index a32f5373e85..eb61197e72d 100644 --- a/libgfortran/generated/maxloc0_8_i4.c +++ b/libgfortran/generated/maxloc0_8_i4.c @@ -198,6 +198,13 @@ mmaxloc0_8_i4 (gfc_array_i8 * const restrict retarray, index_type n; int mask_kind; + + if (mask == NULL) + { + maxloc0_8_i4 (retarray, array, back); + return; + } + rank = GFC_DESCRIPTOR_RANK (array); if (rank <= 0) runtime_error ("Rank of array needs to be > 0"); @@ -369,7 +376,7 @@ smaxloc0_8_i4 (gfc_array_i8 * const restrict retarray, index_type n; GFC_INTEGER_8 *dest; - if (*mask) + if (mask == NULL || *mask) { maxloc0_8_i4 (retarray, array, back); return; diff --git a/libgfortran/generated/maxloc0_8_i8.c b/libgfortran/generated/maxloc0_8_i8.c index ff9de7fa01a..9e1abfbcb50 100644 --- a/libgfortran/generated/maxloc0_8_i8.c +++ b/libgfortran/generated/maxloc0_8_i8.c @@ -198,6 +198,13 @@ mmaxloc0_8_i8 (gfc_array_i8 * const restrict retarray, index_type n; int mask_kind; + + if (mask == NULL) + { + maxloc0_8_i8 (retarray, array, back); + return; + } + rank = GFC_DESCRIPTOR_RANK (array); if (rank <= 0) runtime_error ("Rank of array needs to be > 0"); @@ -369,7 +376,7 @@ smaxloc0_8_i8 (gfc_array_i8 * const restrict retarray, index_type n; GFC_INTEGER_8 *dest; - if (*mask) + if (mask == NULL || *mask) { maxloc0_8_i8 (retarray, array, back); return; diff --git a/libgfortran/generated/maxloc0_8_r10.c b/libgfortran/generated/maxloc0_8_r10.c index 2aacaf935c7..1073c8bb3f0 100644 --- a/libgfortran/generated/maxloc0_8_r10.c +++ b/libgfortran/generated/maxloc0_8_r10.c @@ -198,6 +198,13 @@ mmaxloc0_8_r10 (gfc_array_i8 * const restrict retarray, index_type n; int mask_kind; + + if (mask == NULL) + { + maxloc0_8_r10 (retarray, array, back); + return; + } + rank = GFC_DESCRIPTOR_RANK (array); if (rank <= 0) runtime_error ("Rank of array needs to be > 0"); @@ -369,7 +376,7 @@ smaxloc0_8_r10 (gfc_array_i8 * const restrict retarray, index_type n; GFC_INTEGER_8 *dest; - if (*mask) + if (mask == NULL || *mask) { maxloc0_8_r10 (retarray, array, back); return; diff --git a/libgfortran/generated/maxloc0_8_r16.c b/libgfortran/generated/maxloc0_8_r16.c index 9ffde922376..c86257880b5 100644 --- a/libgfortran/generated/maxloc0_8_r16.c +++ b/libgfortran/generated/maxloc0_8_r16.c @@ -198,6 +198,13 @@ mmaxloc0_8_r16 (gfc_array_i8 * const restrict retarray, index_type n; int mask_kind; + + if (mask == NULL) + { + maxloc0_8_r16 (retarray, array, back); + return; + } + rank = GFC_DESCRIPTOR_RANK (array); if (rank <= 0) runtime_error ("Rank of array needs to be > 0"); @@ -369,7 +376,7 @@ smaxloc0_8_r16 (gfc_array_i8 * const restrict retarray, index_type n; GFC_INTEGER_8 *dest; - if (*mask) + if (mask == NULL || *mask) { maxloc0_8_r16 (retarray, array, back); return; diff --git a/libgfortran/generated/maxloc0_8_r4.c b/libgfortran/generated/maxloc0_8_r4.c index 755a513a03e..1a4671cc25f 100644 --- a/libgfortran/generated/maxloc0_8_r4.c +++ b/libgfortran/generated/maxloc0_8_r4.c @@ -198,6 +198,13 @@ mmaxloc0_8_r4 (gfc_array_i8 * const restrict retarray, index_type n; int mask_kind; + + if (mask == NULL) + { + maxloc0_8_r4 (retarray, array, back); + return; + } + rank = GFC_DESCRIPTOR_RANK (array); if (rank <= 0) runtime_error ("Rank of array needs to be > 0"); @@ -369,7 +376,7 @@ smaxloc0_8_r4 (gfc_array_i8 * const restrict retarray, index_type n; GFC_INTEGER_8 *dest; - if (*mask) + if (mask == NULL || *mask) { maxloc0_8_r4 (retarray, array, back); return; diff --git a/libgfortran/generated/maxloc0_8_r8.c b/libgfortran/generated/maxloc0_8_r8.c index 1bd2bf04572..49480c618fc 100644 --- a/libgfortran/generated/maxloc0_8_r8.c +++ b/libgfortran/generated/maxloc0_8_r8.c @@ -198,6 +198,13 @@ mmaxloc0_8_r8 (gfc_array_i8 * const restrict retarray, index_type n; int mask_kind; + + if (mask == NULL) + { + maxloc0_8_r8 (retarray, array, back); + return; + } + rank = GFC_DESCRIPTOR_RANK (array); if (rank <= 0) runtime_error ("Rank of array needs to be > 0"); @@ -369,7 +376,7 @@ smaxloc0_8_r8 (gfc_array_i8 * const restrict retarray, index_type n; GFC_INTEGER_8 *dest; - if (*mask) + if (mask == NULL || *mask) { maxloc0_8_r8 (retarray, array, back); return; diff --git a/libgfortran/generated/maxloc0_8_s1.c b/libgfortran/generated/maxloc0_8_s1.c index 173aa13dc63..a36e1df7acc 100644 --- a/libgfortran/generated/maxloc0_8_s1.c +++ b/libgfortran/generated/maxloc0_8_s1.c @@ -174,6 +174,16 @@ mmaxloc0_8_s1 (gfc_array_i8 * const restrict retarray, index_type n; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + maxloc0_8_s1 (retarray, array, back, len); +#else + maxloc0_8_s1 (retarray, array, len); +#endif + return; + } + rank = GFC_DESCRIPTOR_RANK (array); if (rank <= 0) runtime_error ("Rank of array needs to be > 0"); @@ -304,7 +314,7 @@ smaxloc0_8_s1 (gfc_array_i8 * const restrict retarray, index_type n; GFC_INTEGER_8 *dest; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG maxloc0_8_s1 (retarray, array, back, len); diff --git a/libgfortran/generated/maxloc0_8_s4.c b/libgfortran/generated/maxloc0_8_s4.c index 60176b4bbb9..fc28686976b 100644 --- a/libgfortran/generated/maxloc0_8_s4.c +++ b/libgfortran/generated/maxloc0_8_s4.c @@ -174,6 +174,16 @@ mmaxloc0_8_s4 (gfc_array_i8 * const restrict retarray, index_type n; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + maxloc0_8_s4 (retarray, array, back, len); +#else + maxloc0_8_s4 (retarray, array, len); +#endif + return; + } + rank = GFC_DESCRIPTOR_RANK (array); if (rank <= 0) runtime_error ("Rank of array needs to be > 0"); @@ -304,7 +314,7 @@ smaxloc0_8_s4 (gfc_array_i8 * const restrict retarray, index_type n; GFC_INTEGER_8 *dest; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG maxloc0_8_s4 (retarray, array, back, len); diff --git a/libgfortran/generated/maxloc1_16_i1.c b/libgfortran/generated/maxloc1_16_i1.c index 70b0ba566c5..bea0f3a8e8c 100644 --- a/libgfortran/generated/maxloc1_16_i1.c +++ b/libgfortran/generated/maxloc1_16_i1.c @@ -248,6 +248,16 @@ mmaxloc1_16_i1 (gfc_array_i16 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + maxloc1_16_i1 (retarray, array, pdim, back); +#else + maxloc1_16_i1 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -470,7 +480,7 @@ smaxloc1_16_i1 (gfc_array_i16 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG maxloc1_16_i1 (retarray, array, pdim, back); diff --git a/libgfortran/generated/maxloc1_16_i16.c b/libgfortran/generated/maxloc1_16_i16.c index 99310e10a1b..a51d7e2a9d2 100644 --- a/libgfortran/generated/maxloc1_16_i16.c +++ b/libgfortran/generated/maxloc1_16_i16.c @@ -248,6 +248,16 @@ mmaxloc1_16_i16 (gfc_array_i16 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + maxloc1_16_i16 (retarray, array, pdim, back); +#else + maxloc1_16_i16 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -470,7 +480,7 @@ smaxloc1_16_i16 (gfc_array_i16 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG maxloc1_16_i16 (retarray, array, pdim, back); diff --git a/libgfortran/generated/maxloc1_16_i2.c b/libgfortran/generated/maxloc1_16_i2.c index ac8b39154c9..ccbc7c95695 100644 --- a/libgfortran/generated/maxloc1_16_i2.c +++ b/libgfortran/generated/maxloc1_16_i2.c @@ -248,6 +248,16 @@ mmaxloc1_16_i2 (gfc_array_i16 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + maxloc1_16_i2 (retarray, array, pdim, back); +#else + maxloc1_16_i2 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -470,7 +480,7 @@ smaxloc1_16_i2 (gfc_array_i16 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG maxloc1_16_i2 (retarray, array, pdim, back); diff --git a/libgfortran/generated/maxloc1_16_i4.c b/libgfortran/generated/maxloc1_16_i4.c index 12f2c875cf0..f92d61f25f4 100644 --- a/libgfortran/generated/maxloc1_16_i4.c +++ b/libgfortran/generated/maxloc1_16_i4.c @@ -248,6 +248,16 @@ mmaxloc1_16_i4 (gfc_array_i16 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + maxloc1_16_i4 (retarray, array, pdim, back); +#else + maxloc1_16_i4 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -470,7 +480,7 @@ smaxloc1_16_i4 (gfc_array_i16 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG maxloc1_16_i4 (retarray, array, pdim, back); diff --git a/libgfortran/generated/maxloc1_16_i8.c b/libgfortran/generated/maxloc1_16_i8.c index e8fb57bd7b0..75525645bed 100644 --- a/libgfortran/generated/maxloc1_16_i8.c +++ b/libgfortran/generated/maxloc1_16_i8.c @@ -248,6 +248,16 @@ mmaxloc1_16_i8 (gfc_array_i16 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + maxloc1_16_i8 (retarray, array, pdim, back); +#else + maxloc1_16_i8 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -470,7 +480,7 @@ smaxloc1_16_i8 (gfc_array_i16 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG maxloc1_16_i8 (retarray, array, pdim, back); diff --git a/libgfortran/generated/maxloc1_16_r10.c b/libgfortran/generated/maxloc1_16_r10.c index b610133bf6b..dc5e27c4631 100644 --- a/libgfortran/generated/maxloc1_16_r10.c +++ b/libgfortran/generated/maxloc1_16_r10.c @@ -248,6 +248,16 @@ mmaxloc1_16_r10 (gfc_array_i16 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + maxloc1_16_r10 (retarray, array, pdim, back); +#else + maxloc1_16_r10 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -470,7 +480,7 @@ smaxloc1_16_r10 (gfc_array_i16 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG maxloc1_16_r10 (retarray, array, pdim, back); diff --git a/libgfortran/generated/maxloc1_16_r16.c b/libgfortran/generated/maxloc1_16_r16.c index 44aaf0f1f3f..c562d18c337 100644 --- a/libgfortran/generated/maxloc1_16_r16.c +++ b/libgfortran/generated/maxloc1_16_r16.c @@ -248,6 +248,16 @@ mmaxloc1_16_r16 (gfc_array_i16 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + maxloc1_16_r16 (retarray, array, pdim, back); +#else + maxloc1_16_r16 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -470,7 +480,7 @@ smaxloc1_16_r16 (gfc_array_i16 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG maxloc1_16_r16 (retarray, array, pdim, back); diff --git a/libgfortran/generated/maxloc1_16_r4.c b/libgfortran/generated/maxloc1_16_r4.c index aefba16f018..4a48f722bd5 100644 --- a/libgfortran/generated/maxloc1_16_r4.c +++ b/libgfortran/generated/maxloc1_16_r4.c @@ -248,6 +248,16 @@ mmaxloc1_16_r4 (gfc_array_i16 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + maxloc1_16_r4 (retarray, array, pdim, back); +#else + maxloc1_16_r4 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -470,7 +480,7 @@ smaxloc1_16_r4 (gfc_array_i16 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG maxloc1_16_r4 (retarray, array, pdim, back); diff --git a/libgfortran/generated/maxloc1_16_r8.c b/libgfortran/generated/maxloc1_16_r8.c index 9c8b1939bac..aca6cc64171 100644 --- a/libgfortran/generated/maxloc1_16_r8.c +++ b/libgfortran/generated/maxloc1_16_r8.c @@ -248,6 +248,16 @@ mmaxloc1_16_r8 (gfc_array_i16 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + maxloc1_16_r8 (retarray, array, pdim, back); +#else + maxloc1_16_r8 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -470,7 +480,7 @@ smaxloc1_16_r8 (gfc_array_i16 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG maxloc1_16_r8 (retarray, array, pdim, back); diff --git a/libgfortran/generated/maxloc1_16_s1.c b/libgfortran/generated/maxloc1_16_s1.c index 538d44c0966..edc19759a00 100644 --- a/libgfortran/generated/maxloc1_16_s1.c +++ b/libgfortran/generated/maxloc1_16_s1.c @@ -241,6 +241,16 @@ mmaxloc1_16_s1 (gfc_array_i16 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + maxloc1_16_s1 (retarray, array, pdim, back, string_len); +#else + maxloc1_16_s1 (retarray, array, pdim, string_len); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -436,7 +446,7 @@ smaxloc1_16_s1 (gfc_array_i16 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG maxloc1_16_s1 (retarray, array, pdim, back, string_len); diff --git a/libgfortran/generated/maxloc1_16_s4.c b/libgfortran/generated/maxloc1_16_s4.c index dce5c890376..0f94b7b61c1 100644 --- a/libgfortran/generated/maxloc1_16_s4.c +++ b/libgfortran/generated/maxloc1_16_s4.c @@ -241,6 +241,16 @@ mmaxloc1_16_s4 (gfc_array_i16 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + maxloc1_16_s4 (retarray, array, pdim, back, string_len); +#else + maxloc1_16_s4 (retarray, array, pdim, string_len); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -436,7 +446,7 @@ smaxloc1_16_s4 (gfc_array_i16 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG maxloc1_16_s4 (retarray, array, pdim, back, string_len); diff --git a/libgfortran/generated/maxloc1_4_i1.c b/libgfortran/generated/maxloc1_4_i1.c index 7bcb5bbaa1c..ad953ac49a8 100644 --- a/libgfortran/generated/maxloc1_4_i1.c +++ b/libgfortran/generated/maxloc1_4_i1.c @@ -248,6 +248,16 @@ mmaxloc1_4_i1 (gfc_array_i4 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + maxloc1_4_i1 (retarray, array, pdim, back); +#else + maxloc1_4_i1 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -470,7 +480,7 @@ smaxloc1_4_i1 (gfc_array_i4 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG maxloc1_4_i1 (retarray, array, pdim, back); diff --git a/libgfortran/generated/maxloc1_4_i16.c b/libgfortran/generated/maxloc1_4_i16.c index 8e1ba58faa2..6cbebebbc68 100644 --- a/libgfortran/generated/maxloc1_4_i16.c +++ b/libgfortran/generated/maxloc1_4_i16.c @@ -248,6 +248,16 @@ mmaxloc1_4_i16 (gfc_array_i4 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + maxloc1_4_i16 (retarray, array, pdim, back); +#else + maxloc1_4_i16 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -470,7 +480,7 @@ smaxloc1_4_i16 (gfc_array_i4 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG maxloc1_4_i16 (retarray, array, pdim, back); diff --git a/libgfortran/generated/maxloc1_4_i2.c b/libgfortran/generated/maxloc1_4_i2.c index 62175d2a593..70dedf76e8d 100644 --- a/libgfortran/generated/maxloc1_4_i2.c +++ b/libgfortran/generated/maxloc1_4_i2.c @@ -248,6 +248,16 @@ mmaxloc1_4_i2 (gfc_array_i4 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + maxloc1_4_i2 (retarray, array, pdim, back); +#else + maxloc1_4_i2 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -470,7 +480,7 @@ smaxloc1_4_i2 (gfc_array_i4 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG maxloc1_4_i2 (retarray, array, pdim, back); diff --git a/libgfortran/generated/maxloc1_4_i4.c b/libgfortran/generated/maxloc1_4_i4.c index b507ab34507..775ada997ce 100644 --- a/libgfortran/generated/maxloc1_4_i4.c +++ b/libgfortran/generated/maxloc1_4_i4.c @@ -248,6 +248,16 @@ mmaxloc1_4_i4 (gfc_array_i4 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + maxloc1_4_i4 (retarray, array, pdim, back); +#else + maxloc1_4_i4 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -470,7 +480,7 @@ smaxloc1_4_i4 (gfc_array_i4 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG maxloc1_4_i4 (retarray, array, pdim, back); diff --git a/libgfortran/generated/maxloc1_4_i8.c b/libgfortran/generated/maxloc1_4_i8.c index 752b2318154..e9361fe2455 100644 --- a/libgfortran/generated/maxloc1_4_i8.c +++ b/libgfortran/generated/maxloc1_4_i8.c @@ -248,6 +248,16 @@ mmaxloc1_4_i8 (gfc_array_i4 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + maxloc1_4_i8 (retarray, array, pdim, back); +#else + maxloc1_4_i8 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -470,7 +480,7 @@ smaxloc1_4_i8 (gfc_array_i4 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG maxloc1_4_i8 (retarray, array, pdim, back); diff --git a/libgfortran/generated/maxloc1_4_r10.c b/libgfortran/generated/maxloc1_4_r10.c index 851fd715f87..0ce1684640b 100644 --- a/libgfortran/generated/maxloc1_4_r10.c +++ b/libgfortran/generated/maxloc1_4_r10.c @@ -248,6 +248,16 @@ mmaxloc1_4_r10 (gfc_array_i4 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + maxloc1_4_r10 (retarray, array, pdim, back); +#else + maxloc1_4_r10 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -470,7 +480,7 @@ smaxloc1_4_r10 (gfc_array_i4 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG maxloc1_4_r10 (retarray, array, pdim, back); diff --git a/libgfortran/generated/maxloc1_4_r16.c b/libgfortran/generated/maxloc1_4_r16.c index b23f7a58cca..b96a7f6770a 100644 --- a/libgfortran/generated/maxloc1_4_r16.c +++ b/libgfortran/generated/maxloc1_4_r16.c @@ -248,6 +248,16 @@ mmaxloc1_4_r16 (gfc_array_i4 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + maxloc1_4_r16 (retarray, array, pdim, back); +#else + maxloc1_4_r16 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -470,7 +480,7 @@ smaxloc1_4_r16 (gfc_array_i4 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG maxloc1_4_r16 (retarray, array, pdim, back); diff --git a/libgfortran/generated/maxloc1_4_r4.c b/libgfortran/generated/maxloc1_4_r4.c index 9cf13751cb3..ff2e105ae1d 100644 --- a/libgfortran/generated/maxloc1_4_r4.c +++ b/libgfortran/generated/maxloc1_4_r4.c @@ -248,6 +248,16 @@ mmaxloc1_4_r4 (gfc_array_i4 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + maxloc1_4_r4 (retarray, array, pdim, back); +#else + maxloc1_4_r4 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -470,7 +480,7 @@ smaxloc1_4_r4 (gfc_array_i4 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG maxloc1_4_r4 (retarray, array, pdim, back); diff --git a/libgfortran/generated/maxloc1_4_r8.c b/libgfortran/generated/maxloc1_4_r8.c index e6884f297a7..d6bbc47b884 100644 --- a/libgfortran/generated/maxloc1_4_r8.c +++ b/libgfortran/generated/maxloc1_4_r8.c @@ -248,6 +248,16 @@ mmaxloc1_4_r8 (gfc_array_i4 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + maxloc1_4_r8 (retarray, array, pdim, back); +#else + maxloc1_4_r8 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -470,7 +480,7 @@ smaxloc1_4_r8 (gfc_array_i4 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG maxloc1_4_r8 (retarray, array, pdim, back); diff --git a/libgfortran/generated/maxloc1_4_s1.c b/libgfortran/generated/maxloc1_4_s1.c index d194d70b7d2..944d7111ba2 100644 --- a/libgfortran/generated/maxloc1_4_s1.c +++ b/libgfortran/generated/maxloc1_4_s1.c @@ -241,6 +241,16 @@ mmaxloc1_4_s1 (gfc_array_i4 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + maxloc1_4_s1 (retarray, array, pdim, back, string_len); +#else + maxloc1_4_s1 (retarray, array, pdim, string_len); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -436,7 +446,7 @@ smaxloc1_4_s1 (gfc_array_i4 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG maxloc1_4_s1 (retarray, array, pdim, back, string_len); diff --git a/libgfortran/generated/maxloc1_4_s4.c b/libgfortran/generated/maxloc1_4_s4.c index b3e68b5377d..8afa10cf4eb 100644 --- a/libgfortran/generated/maxloc1_4_s4.c +++ b/libgfortran/generated/maxloc1_4_s4.c @@ -241,6 +241,16 @@ mmaxloc1_4_s4 (gfc_array_i4 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + maxloc1_4_s4 (retarray, array, pdim, back, string_len); +#else + maxloc1_4_s4 (retarray, array, pdim, string_len); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -436,7 +446,7 @@ smaxloc1_4_s4 (gfc_array_i4 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG maxloc1_4_s4 (retarray, array, pdim, back, string_len); diff --git a/libgfortran/generated/maxloc1_8_i1.c b/libgfortran/generated/maxloc1_8_i1.c index cd9bb651874..bb6e1012dc6 100644 --- a/libgfortran/generated/maxloc1_8_i1.c +++ b/libgfortran/generated/maxloc1_8_i1.c @@ -248,6 +248,16 @@ mmaxloc1_8_i1 (gfc_array_i8 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + maxloc1_8_i1 (retarray, array, pdim, back); +#else + maxloc1_8_i1 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -470,7 +480,7 @@ smaxloc1_8_i1 (gfc_array_i8 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG maxloc1_8_i1 (retarray, array, pdim, back); diff --git a/libgfortran/generated/maxloc1_8_i16.c b/libgfortran/generated/maxloc1_8_i16.c index 0c78ec8417e..a15ded8a928 100644 --- a/libgfortran/generated/maxloc1_8_i16.c +++ b/libgfortran/generated/maxloc1_8_i16.c @@ -248,6 +248,16 @@ mmaxloc1_8_i16 (gfc_array_i8 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + maxloc1_8_i16 (retarray, array, pdim, back); +#else + maxloc1_8_i16 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -470,7 +480,7 @@ smaxloc1_8_i16 (gfc_array_i8 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG maxloc1_8_i16 (retarray, array, pdim, back); diff --git a/libgfortran/generated/maxloc1_8_i2.c b/libgfortran/generated/maxloc1_8_i2.c index 41cf3b1758e..7435c5e38be 100644 --- a/libgfortran/generated/maxloc1_8_i2.c +++ b/libgfortran/generated/maxloc1_8_i2.c @@ -248,6 +248,16 @@ mmaxloc1_8_i2 (gfc_array_i8 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + maxloc1_8_i2 (retarray, array, pdim, back); +#else + maxloc1_8_i2 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -470,7 +480,7 @@ smaxloc1_8_i2 (gfc_array_i8 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG maxloc1_8_i2 (retarray, array, pdim, back); diff --git a/libgfortran/generated/maxloc1_8_i4.c b/libgfortran/generated/maxloc1_8_i4.c index 46ff5bb15ef..b921916bac5 100644 --- a/libgfortran/generated/maxloc1_8_i4.c +++ b/libgfortran/generated/maxloc1_8_i4.c @@ -248,6 +248,16 @@ mmaxloc1_8_i4 (gfc_array_i8 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + maxloc1_8_i4 (retarray, array, pdim, back); +#else + maxloc1_8_i4 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -470,7 +480,7 @@ smaxloc1_8_i4 (gfc_array_i8 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG maxloc1_8_i4 (retarray, array, pdim, back); diff --git a/libgfortran/generated/maxloc1_8_i8.c b/libgfortran/generated/maxloc1_8_i8.c index 312467586f5..9cc0a8ef6f2 100644 --- a/libgfortran/generated/maxloc1_8_i8.c +++ b/libgfortran/generated/maxloc1_8_i8.c @@ -248,6 +248,16 @@ mmaxloc1_8_i8 (gfc_array_i8 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + maxloc1_8_i8 (retarray, array, pdim, back); +#else + maxloc1_8_i8 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -470,7 +480,7 @@ smaxloc1_8_i8 (gfc_array_i8 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG maxloc1_8_i8 (retarray, array, pdim, back); diff --git a/libgfortran/generated/maxloc1_8_r10.c b/libgfortran/generated/maxloc1_8_r10.c index c8d025f37a1..e0d44ab1c03 100644 --- a/libgfortran/generated/maxloc1_8_r10.c +++ b/libgfortran/generated/maxloc1_8_r10.c @@ -248,6 +248,16 @@ mmaxloc1_8_r10 (gfc_array_i8 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + maxloc1_8_r10 (retarray, array, pdim, back); +#else + maxloc1_8_r10 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -470,7 +480,7 @@ smaxloc1_8_r10 (gfc_array_i8 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG maxloc1_8_r10 (retarray, array, pdim, back); diff --git a/libgfortran/generated/maxloc1_8_r16.c b/libgfortran/generated/maxloc1_8_r16.c index b1ef57c5b63..de3ed8f8dc6 100644 --- a/libgfortran/generated/maxloc1_8_r16.c +++ b/libgfortran/generated/maxloc1_8_r16.c @@ -248,6 +248,16 @@ mmaxloc1_8_r16 (gfc_array_i8 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + maxloc1_8_r16 (retarray, array, pdim, back); +#else + maxloc1_8_r16 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -470,7 +480,7 @@ smaxloc1_8_r16 (gfc_array_i8 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG maxloc1_8_r16 (retarray, array, pdim, back); diff --git a/libgfortran/generated/maxloc1_8_r4.c b/libgfortran/generated/maxloc1_8_r4.c index b9b57bfdd86..f876b2509f8 100644 --- a/libgfortran/generated/maxloc1_8_r4.c +++ b/libgfortran/generated/maxloc1_8_r4.c @@ -248,6 +248,16 @@ mmaxloc1_8_r4 (gfc_array_i8 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + maxloc1_8_r4 (retarray, array, pdim, back); +#else + maxloc1_8_r4 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -470,7 +480,7 @@ smaxloc1_8_r4 (gfc_array_i8 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG maxloc1_8_r4 (retarray, array, pdim, back); diff --git a/libgfortran/generated/maxloc1_8_r8.c b/libgfortran/generated/maxloc1_8_r8.c index 08fd7781801..6d27c2d48ba 100644 --- a/libgfortran/generated/maxloc1_8_r8.c +++ b/libgfortran/generated/maxloc1_8_r8.c @@ -248,6 +248,16 @@ mmaxloc1_8_r8 (gfc_array_i8 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + maxloc1_8_r8 (retarray, array, pdim, back); +#else + maxloc1_8_r8 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -470,7 +480,7 @@ smaxloc1_8_r8 (gfc_array_i8 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG maxloc1_8_r8 (retarray, array, pdim, back); diff --git a/libgfortran/generated/maxloc1_8_s1.c b/libgfortran/generated/maxloc1_8_s1.c index 0832e7bea85..9f693366114 100644 --- a/libgfortran/generated/maxloc1_8_s1.c +++ b/libgfortran/generated/maxloc1_8_s1.c @@ -241,6 +241,16 @@ mmaxloc1_8_s1 (gfc_array_i8 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + maxloc1_8_s1 (retarray, array, pdim, back, string_len); +#else + maxloc1_8_s1 (retarray, array, pdim, string_len); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -436,7 +446,7 @@ smaxloc1_8_s1 (gfc_array_i8 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG maxloc1_8_s1 (retarray, array, pdim, back, string_len); diff --git a/libgfortran/generated/maxloc1_8_s4.c b/libgfortran/generated/maxloc1_8_s4.c index 967f3fdd30c..1b7bb79584e 100644 --- a/libgfortran/generated/maxloc1_8_s4.c +++ b/libgfortran/generated/maxloc1_8_s4.c @@ -241,6 +241,16 @@ mmaxloc1_8_s4 (gfc_array_i8 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + maxloc1_8_s4 (retarray, array, pdim, back, string_len); +#else + maxloc1_8_s4 (retarray, array, pdim, string_len); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -436,7 +446,7 @@ smaxloc1_8_s4 (gfc_array_i8 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG maxloc1_8_s4 (retarray, array, pdim, back, string_len); diff --git a/libgfortran/generated/maxval0_s1.c b/libgfortran/generated/maxval0_s1.c index 690391866f0..67dcbd014cf 100644 --- a/libgfortran/generated/maxval0_s1.c +++ b/libgfortran/generated/maxval0_s1.c @@ -150,6 +150,12 @@ mmaxval0_s1 (GFC_UINTEGER_1 * const restrict ret, index_type n; int mask_kind; + if (mask == NULL) + { + maxval0_s1 (ret, xlen, array, len); + return; + } + rank = GFC_DESCRIPTOR_RANK (array); if (rank <= 0) runtime_error ("Rank of array needs to be > 0"); @@ -247,7 +253,7 @@ smaxval0_s1 (GFC_UINTEGER_1 * restrict ret, GFC_LOGICAL_4 *mask, gfc_charlen_type len) { - if (*mask) + if (mask == NULL || *mask) { maxval0_s1 (ret, xlen, array, len); return; diff --git a/libgfortran/generated/maxval0_s4.c b/libgfortran/generated/maxval0_s4.c index 111a5ded268..e9d95368a67 100644 --- a/libgfortran/generated/maxval0_s4.c +++ b/libgfortran/generated/maxval0_s4.c @@ -150,6 +150,12 @@ mmaxval0_s4 (GFC_UINTEGER_4 * const restrict ret, index_type n; int mask_kind; + if (mask == NULL) + { + maxval0_s4 (ret, xlen, array, len); + return; + } + rank = GFC_DESCRIPTOR_RANK (array); if (rank <= 0) runtime_error ("Rank of array needs to be > 0"); @@ -247,7 +253,7 @@ smaxval0_s4 (GFC_UINTEGER_4 * restrict ret, GFC_LOGICAL_4 *mask, gfc_charlen_type len) { - if (*mask) + if (mask == NULL || *mask) { maxval0_s4 (ret, xlen, array, len); return; diff --git a/libgfortran/generated/maxval1_s1.c b/libgfortran/generated/maxval1_s1.c index 1cc6483cd6c..15e6bc2bec2 100644 --- a/libgfortran/generated/maxval1_s1.c +++ b/libgfortran/generated/maxval1_s1.c @@ -239,6 +239,12 @@ mmaxval1_s1 (gfc_array_s1 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { + maxval1_s1 (retarray, xlen, array, pdim, string_len); + return; + } + assert (xlen == string_len); dim = (*pdim) - 1; @@ -436,7 +442,7 @@ smaxval1_s1 (gfc_array_s1 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { maxval1_s1 (retarray, xlen, array, pdim, string_len); return; diff --git a/libgfortran/generated/maxval1_s4.c b/libgfortran/generated/maxval1_s4.c index 6e0e8be2d9c..6021d40b0c8 100644 --- a/libgfortran/generated/maxval1_s4.c +++ b/libgfortran/generated/maxval1_s4.c @@ -239,6 +239,12 @@ mmaxval1_s4 (gfc_array_s4 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { + maxval1_s4 (retarray, xlen, array, pdim, string_len); + return; + } + assert (xlen == string_len); dim = (*pdim) - 1; @@ -436,7 +442,7 @@ smaxval1_s4 (gfc_array_s4 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { maxval1_s4 (retarray, xlen, array, pdim, string_len); return; diff --git a/libgfortran/generated/maxval_i1.c b/libgfortran/generated/maxval_i1.c index defed80a4d7..9688eeae413 100644 --- a/libgfortran/generated/maxval_i1.c +++ b/libgfortran/generated/maxval_i1.c @@ -234,6 +234,16 @@ mmaxval_i1 (gfc_array_i1 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + maxval_i1 (retarray, array, pdim, back); +#else + maxval_i1 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -441,7 +451,7 @@ smaxval_i1 (gfc_array_i1 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG maxval_i1 (retarray, array, pdim, back); diff --git a/libgfortran/generated/maxval_i16.c b/libgfortran/generated/maxval_i16.c index 03526acd89d..5593189ac5f 100644 --- a/libgfortran/generated/maxval_i16.c +++ b/libgfortran/generated/maxval_i16.c @@ -234,6 +234,16 @@ mmaxval_i16 (gfc_array_i16 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + maxval_i16 (retarray, array, pdim, back); +#else + maxval_i16 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -441,7 +451,7 @@ smaxval_i16 (gfc_array_i16 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG maxval_i16 (retarray, array, pdim, back); diff --git a/libgfortran/generated/maxval_i2.c b/libgfortran/generated/maxval_i2.c index 84deb7ea0f7..6f1663286c3 100644 --- a/libgfortran/generated/maxval_i2.c +++ b/libgfortran/generated/maxval_i2.c @@ -234,6 +234,16 @@ mmaxval_i2 (gfc_array_i2 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + maxval_i2 (retarray, array, pdim, back); +#else + maxval_i2 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -441,7 +451,7 @@ smaxval_i2 (gfc_array_i2 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG maxval_i2 (retarray, array, pdim, back); diff --git a/libgfortran/generated/maxval_i4.c b/libgfortran/generated/maxval_i4.c index ae36fd4aa3e..7456c2c031b 100644 --- a/libgfortran/generated/maxval_i4.c +++ b/libgfortran/generated/maxval_i4.c @@ -234,6 +234,16 @@ mmaxval_i4 (gfc_array_i4 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + maxval_i4 (retarray, array, pdim, back); +#else + maxval_i4 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -441,7 +451,7 @@ smaxval_i4 (gfc_array_i4 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG maxval_i4 (retarray, array, pdim, back); diff --git a/libgfortran/generated/maxval_i8.c b/libgfortran/generated/maxval_i8.c index abd8f99b501..afa69d14e5e 100644 --- a/libgfortran/generated/maxval_i8.c +++ b/libgfortran/generated/maxval_i8.c @@ -234,6 +234,16 @@ mmaxval_i8 (gfc_array_i8 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + maxval_i8 (retarray, array, pdim, back); +#else + maxval_i8 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -441,7 +451,7 @@ smaxval_i8 (gfc_array_i8 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG maxval_i8 (retarray, array, pdim, back); diff --git a/libgfortran/generated/maxval_r10.c b/libgfortran/generated/maxval_r10.c index dc640594b2a..b10ce3b4c94 100644 --- a/libgfortran/generated/maxval_r10.c +++ b/libgfortran/generated/maxval_r10.c @@ -234,6 +234,16 @@ mmaxval_r10 (gfc_array_r10 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + maxval_r10 (retarray, array, pdim, back); +#else + maxval_r10 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -441,7 +451,7 @@ smaxval_r10 (gfc_array_r10 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG maxval_r10 (retarray, array, pdim, back); diff --git a/libgfortran/generated/maxval_r16.c b/libgfortran/generated/maxval_r16.c index ccd0f4b6b8a..3645e1c21f2 100644 --- a/libgfortran/generated/maxval_r16.c +++ b/libgfortran/generated/maxval_r16.c @@ -234,6 +234,16 @@ mmaxval_r16 (gfc_array_r16 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + maxval_r16 (retarray, array, pdim, back); +#else + maxval_r16 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -441,7 +451,7 @@ smaxval_r16 (gfc_array_r16 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG maxval_r16 (retarray, array, pdim, back); diff --git a/libgfortran/generated/maxval_r4.c b/libgfortran/generated/maxval_r4.c index 2c26b6ebaba..1f0a70ef110 100644 --- a/libgfortran/generated/maxval_r4.c +++ b/libgfortran/generated/maxval_r4.c @@ -234,6 +234,16 @@ mmaxval_r4 (gfc_array_r4 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + maxval_r4 (retarray, array, pdim, back); +#else + maxval_r4 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -441,7 +451,7 @@ smaxval_r4 (gfc_array_r4 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG maxval_r4 (retarray, array, pdim, back); diff --git a/libgfortran/generated/maxval_r8.c b/libgfortran/generated/maxval_r8.c index 26efe0e4717..a4536ea8121 100644 --- a/libgfortran/generated/maxval_r8.c +++ b/libgfortran/generated/maxval_r8.c @@ -234,6 +234,16 @@ mmaxval_r8 (gfc_array_r8 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + maxval_r8 (retarray, array, pdim, back); +#else + maxval_r8 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -441,7 +451,7 @@ smaxval_r8 (gfc_array_r8 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG maxval_r8 (retarray, array, pdim, back); diff --git a/libgfortran/generated/minloc0_16_i1.c b/libgfortran/generated/minloc0_16_i1.c index 6a1a99a8151..f3df7e65738 100644 --- a/libgfortran/generated/minloc0_16_i1.c +++ b/libgfortran/generated/minloc0_16_i1.c @@ -198,6 +198,13 @@ mminloc0_16_i1 (gfc_array_i16 * const restrict retarray, index_type n; int mask_kind; + + if (mask == NULL) + { + minloc0_16_i1 (retarray, array, back); + return; + } + rank = GFC_DESCRIPTOR_RANK (array); if (rank <= 0) runtime_error ("Rank of array needs to be > 0"); @@ -368,7 +375,7 @@ sminloc0_16_i1 (gfc_array_i16 * const restrict retarray, index_type n; GFC_INTEGER_16 *dest; - if (*mask) + if (mask == NULL || *mask) { minloc0_16_i1 (retarray, array, back); return; diff --git a/libgfortran/generated/minloc0_16_i16.c b/libgfortran/generated/minloc0_16_i16.c index cde4b42482c..01dd0a2a0f2 100644 --- a/libgfortran/generated/minloc0_16_i16.c +++ b/libgfortran/generated/minloc0_16_i16.c @@ -198,6 +198,13 @@ mminloc0_16_i16 (gfc_array_i16 * const restrict retarray, index_type n; int mask_kind; + + if (mask == NULL) + { + minloc0_16_i16 (retarray, array, back); + return; + } + rank = GFC_DESCRIPTOR_RANK (array); if (rank <= 0) runtime_error ("Rank of array needs to be > 0"); @@ -368,7 +375,7 @@ sminloc0_16_i16 (gfc_array_i16 * const restrict retarray, index_type n; GFC_INTEGER_16 *dest; - if (*mask) + if (mask == NULL || *mask) { minloc0_16_i16 (retarray, array, back); return; diff --git a/libgfortran/generated/minloc0_16_i2.c b/libgfortran/generated/minloc0_16_i2.c index 49fd91e665d..95763d7564a 100644 --- a/libgfortran/generated/minloc0_16_i2.c +++ b/libgfortran/generated/minloc0_16_i2.c @@ -198,6 +198,13 @@ mminloc0_16_i2 (gfc_array_i16 * const restrict retarray, index_type n; int mask_kind; + + if (mask == NULL) + { + minloc0_16_i2 (retarray, array, back); + return; + } + rank = GFC_DESCRIPTOR_RANK (array); if (rank <= 0) runtime_error ("Rank of array needs to be > 0"); @@ -368,7 +375,7 @@ sminloc0_16_i2 (gfc_array_i16 * const restrict retarray, index_type n; GFC_INTEGER_16 *dest; - if (*mask) + if (mask == NULL || *mask) { minloc0_16_i2 (retarray, array, back); return; diff --git a/libgfortran/generated/minloc0_16_i4.c b/libgfortran/generated/minloc0_16_i4.c index 1bfc0f7e763..1965ef5d091 100644 --- a/libgfortran/generated/minloc0_16_i4.c +++ b/libgfortran/generated/minloc0_16_i4.c @@ -198,6 +198,13 @@ mminloc0_16_i4 (gfc_array_i16 * const restrict retarray, index_type n; int mask_kind; + + if (mask == NULL) + { + minloc0_16_i4 (retarray, array, back); + return; + } + rank = GFC_DESCRIPTOR_RANK (array); if (rank <= 0) runtime_error ("Rank of array needs to be > 0"); @@ -368,7 +375,7 @@ sminloc0_16_i4 (gfc_array_i16 * const restrict retarray, index_type n; GFC_INTEGER_16 *dest; - if (*mask) + if (mask == NULL || *mask) { minloc0_16_i4 (retarray, array, back); return; diff --git a/libgfortran/generated/minloc0_16_i8.c b/libgfortran/generated/minloc0_16_i8.c index b4d54ae6689..a2ae3592333 100644 --- a/libgfortran/generated/minloc0_16_i8.c +++ b/libgfortran/generated/minloc0_16_i8.c @@ -198,6 +198,13 @@ mminloc0_16_i8 (gfc_array_i16 * const restrict retarray, index_type n; int mask_kind; + + if (mask == NULL) + { + minloc0_16_i8 (retarray, array, back); + return; + } + rank = GFC_DESCRIPTOR_RANK (array); if (rank <= 0) runtime_error ("Rank of array needs to be > 0"); @@ -368,7 +375,7 @@ sminloc0_16_i8 (gfc_array_i16 * const restrict retarray, index_type n; GFC_INTEGER_16 *dest; - if (*mask) + if (mask == NULL || *mask) { minloc0_16_i8 (retarray, array, back); return; diff --git a/libgfortran/generated/minloc0_16_r10.c b/libgfortran/generated/minloc0_16_r10.c index 351d808ada4..206cd32c6f5 100644 --- a/libgfortran/generated/minloc0_16_r10.c +++ b/libgfortran/generated/minloc0_16_r10.c @@ -198,6 +198,13 @@ mminloc0_16_r10 (gfc_array_i16 * const restrict retarray, index_type n; int mask_kind; + + if (mask == NULL) + { + minloc0_16_r10 (retarray, array, back); + return; + } + rank = GFC_DESCRIPTOR_RANK (array); if (rank <= 0) runtime_error ("Rank of array needs to be > 0"); @@ -368,7 +375,7 @@ sminloc0_16_r10 (gfc_array_i16 * const restrict retarray, index_type n; GFC_INTEGER_16 *dest; - if (*mask) + if (mask == NULL || *mask) { minloc0_16_r10 (retarray, array, back); return; diff --git a/libgfortran/generated/minloc0_16_r16.c b/libgfortran/generated/minloc0_16_r16.c index 5a719f46ce3..25559bbefad 100644 --- a/libgfortran/generated/minloc0_16_r16.c +++ b/libgfortran/generated/minloc0_16_r16.c @@ -198,6 +198,13 @@ mminloc0_16_r16 (gfc_array_i16 * const restrict retarray, index_type n; int mask_kind; + + if (mask == NULL) + { + minloc0_16_r16 (retarray, array, back); + return; + } + rank = GFC_DESCRIPTOR_RANK (array); if (rank <= 0) runtime_error ("Rank of array needs to be > 0"); @@ -368,7 +375,7 @@ sminloc0_16_r16 (gfc_array_i16 * const restrict retarray, index_type n; GFC_INTEGER_16 *dest; - if (*mask) + if (mask == NULL || *mask) { minloc0_16_r16 (retarray, array, back); return; diff --git a/libgfortran/generated/minloc0_16_r4.c b/libgfortran/generated/minloc0_16_r4.c index ddeac3d3379..90034daa426 100644 --- a/libgfortran/generated/minloc0_16_r4.c +++ b/libgfortran/generated/minloc0_16_r4.c @@ -198,6 +198,13 @@ mminloc0_16_r4 (gfc_array_i16 * const restrict retarray, index_type n; int mask_kind; + + if (mask == NULL) + { + minloc0_16_r4 (retarray, array, back); + return; + } + rank = GFC_DESCRIPTOR_RANK (array); if (rank <= 0) runtime_error ("Rank of array needs to be > 0"); @@ -368,7 +375,7 @@ sminloc0_16_r4 (gfc_array_i16 * const restrict retarray, index_type n; GFC_INTEGER_16 *dest; - if (*mask) + if (mask == NULL || *mask) { minloc0_16_r4 (retarray, array, back); return; diff --git a/libgfortran/generated/minloc0_16_r8.c b/libgfortran/generated/minloc0_16_r8.c index c09a1602d3d..3dc777f6f64 100644 --- a/libgfortran/generated/minloc0_16_r8.c +++ b/libgfortran/generated/minloc0_16_r8.c @@ -198,6 +198,13 @@ mminloc0_16_r8 (gfc_array_i16 * const restrict retarray, index_type n; int mask_kind; + + if (mask == NULL) + { + minloc0_16_r8 (retarray, array, back); + return; + } + rank = GFC_DESCRIPTOR_RANK (array); if (rank <= 0) runtime_error ("Rank of array needs to be > 0"); @@ -368,7 +375,7 @@ sminloc0_16_r8 (gfc_array_i16 * const restrict retarray, index_type n; GFC_INTEGER_16 *dest; - if (*mask) + if (mask == NULL || *mask) { minloc0_16_r8 (retarray, array, back); return; diff --git a/libgfortran/generated/minloc0_16_s1.c b/libgfortran/generated/minloc0_16_s1.c index 66fa30c4c63..1b2ee301946 100644 --- a/libgfortran/generated/minloc0_16_s1.c +++ b/libgfortran/generated/minloc0_16_s1.c @@ -174,6 +174,16 @@ mminloc0_16_s1 (gfc_array_i16 * const restrict retarray, index_type n; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + minloc0_16_s1 (retarray, array, back, len); +#else + minloc0_16_s1 (retarray, array, len); +#endif + return; + } + rank = GFC_DESCRIPTOR_RANK (array); if (rank <= 0) runtime_error ("Rank of array needs to be > 0"); @@ -304,7 +314,7 @@ sminloc0_16_s1 (gfc_array_i16 * const restrict retarray, index_type n; GFC_INTEGER_16 *dest; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG minloc0_16_s1 (retarray, array, back, len); diff --git a/libgfortran/generated/minloc0_16_s4.c b/libgfortran/generated/minloc0_16_s4.c index 378990c45c0..63b91c8ee7b 100644 --- a/libgfortran/generated/minloc0_16_s4.c +++ b/libgfortran/generated/minloc0_16_s4.c @@ -174,6 +174,16 @@ mminloc0_16_s4 (gfc_array_i16 * const restrict retarray, index_type n; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + minloc0_16_s4 (retarray, array, back, len); +#else + minloc0_16_s4 (retarray, array, len); +#endif + return; + } + rank = GFC_DESCRIPTOR_RANK (array); if (rank <= 0) runtime_error ("Rank of array needs to be > 0"); @@ -304,7 +314,7 @@ sminloc0_16_s4 (gfc_array_i16 * const restrict retarray, index_type n; GFC_INTEGER_16 *dest; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG minloc0_16_s4 (retarray, array, back, len); diff --git a/libgfortran/generated/minloc0_4_i1.c b/libgfortran/generated/minloc0_4_i1.c index c0f89a80c79..0783f9eccea 100644 --- a/libgfortran/generated/minloc0_4_i1.c +++ b/libgfortran/generated/minloc0_4_i1.c @@ -198,6 +198,13 @@ mminloc0_4_i1 (gfc_array_i4 * const restrict retarray, index_type n; int mask_kind; + + if (mask == NULL) + { + minloc0_4_i1 (retarray, array, back); + return; + } + rank = GFC_DESCRIPTOR_RANK (array); if (rank <= 0) runtime_error ("Rank of array needs to be > 0"); @@ -368,7 +375,7 @@ sminloc0_4_i1 (gfc_array_i4 * const restrict retarray, index_type n; GFC_INTEGER_4 *dest; - if (*mask) + if (mask == NULL || *mask) { minloc0_4_i1 (retarray, array, back); return; diff --git a/libgfortran/generated/minloc0_4_i16.c b/libgfortran/generated/minloc0_4_i16.c index dbcaf839a87..1388531892a 100644 --- a/libgfortran/generated/minloc0_4_i16.c +++ b/libgfortran/generated/minloc0_4_i16.c @@ -198,6 +198,13 @@ mminloc0_4_i16 (gfc_array_i4 * const restrict retarray, index_type n; int mask_kind; + + if (mask == NULL) + { + minloc0_4_i16 (retarray, array, back); + return; + } + rank = GFC_DESCRIPTOR_RANK (array); if (rank <= 0) runtime_error ("Rank of array needs to be > 0"); @@ -368,7 +375,7 @@ sminloc0_4_i16 (gfc_array_i4 * const restrict retarray, index_type n; GFC_INTEGER_4 *dest; - if (*mask) + if (mask == NULL || *mask) { minloc0_4_i16 (retarray, array, back); return; diff --git a/libgfortran/generated/minloc0_4_i2.c b/libgfortran/generated/minloc0_4_i2.c index dbd3e4c7bd7..23900f2c8a4 100644 --- a/libgfortran/generated/minloc0_4_i2.c +++ b/libgfortran/generated/minloc0_4_i2.c @@ -198,6 +198,13 @@ mminloc0_4_i2 (gfc_array_i4 * const restrict retarray, index_type n; int mask_kind; + + if (mask == NULL) + { + minloc0_4_i2 (retarray, array, back); + return; + } + rank = GFC_DESCRIPTOR_RANK (array); if (rank <= 0) runtime_error ("Rank of array needs to be > 0"); @@ -368,7 +375,7 @@ sminloc0_4_i2 (gfc_array_i4 * const restrict retarray, index_type n; GFC_INTEGER_4 *dest; - if (*mask) + if (mask == NULL || *mask) { minloc0_4_i2 (retarray, array, back); return; diff --git a/libgfortran/generated/minloc0_4_i4.c b/libgfortran/generated/minloc0_4_i4.c index d2c6a91ec2c..7c65389eb80 100644 --- a/libgfortran/generated/minloc0_4_i4.c +++ b/libgfortran/generated/minloc0_4_i4.c @@ -198,6 +198,13 @@ mminloc0_4_i4 (gfc_array_i4 * const restrict retarray, index_type n; int mask_kind; + + if (mask == NULL) + { + minloc0_4_i4 (retarray, array, back); + return; + } + rank = GFC_DESCRIPTOR_RANK (array); if (rank <= 0) runtime_error ("Rank of array needs to be > 0"); @@ -368,7 +375,7 @@ sminloc0_4_i4 (gfc_array_i4 * const restrict retarray, index_type n; GFC_INTEGER_4 *dest; - if (*mask) + if (mask == NULL || *mask) { minloc0_4_i4 (retarray, array, back); return; diff --git a/libgfortran/generated/minloc0_4_i8.c b/libgfortran/generated/minloc0_4_i8.c index 4d38e2c7e47..6af912e7f86 100644 --- a/libgfortran/generated/minloc0_4_i8.c +++ b/libgfortran/generated/minloc0_4_i8.c @@ -198,6 +198,13 @@ mminloc0_4_i8 (gfc_array_i4 * const restrict retarray, index_type n; int mask_kind; + + if (mask == NULL) + { + minloc0_4_i8 (retarray, array, back); + return; + } + rank = GFC_DESCRIPTOR_RANK (array); if (rank <= 0) runtime_error ("Rank of array needs to be > 0"); @@ -368,7 +375,7 @@ sminloc0_4_i8 (gfc_array_i4 * const restrict retarray, index_type n; GFC_INTEGER_4 *dest; - if (*mask) + if (mask == NULL || *mask) { minloc0_4_i8 (retarray, array, back); return; diff --git a/libgfortran/generated/minloc0_4_r10.c b/libgfortran/generated/minloc0_4_r10.c index b9f68e4d0a4..f6351f8ad66 100644 --- a/libgfortran/generated/minloc0_4_r10.c +++ b/libgfortran/generated/minloc0_4_r10.c @@ -198,6 +198,13 @@ mminloc0_4_r10 (gfc_array_i4 * const restrict retarray, index_type n; int mask_kind; + + if (mask == NULL) + { + minloc0_4_r10 (retarray, array, back); + return; + } + rank = GFC_DESCRIPTOR_RANK (array); if (rank <= 0) runtime_error ("Rank of array needs to be > 0"); @@ -368,7 +375,7 @@ sminloc0_4_r10 (gfc_array_i4 * const restrict retarray, index_type n; GFC_INTEGER_4 *dest; - if (*mask) + if (mask == NULL || *mask) { minloc0_4_r10 (retarray, array, back); return; diff --git a/libgfortran/generated/minloc0_4_r16.c b/libgfortran/generated/minloc0_4_r16.c index 075ae445a3a..7232cef9117 100644 --- a/libgfortran/generated/minloc0_4_r16.c +++ b/libgfortran/generated/minloc0_4_r16.c @@ -198,6 +198,13 @@ mminloc0_4_r16 (gfc_array_i4 * const restrict retarray, index_type n; int mask_kind; + + if (mask == NULL) + { + minloc0_4_r16 (retarray, array, back); + return; + } + rank = GFC_DESCRIPTOR_RANK (array); if (rank <= 0) runtime_error ("Rank of array needs to be > 0"); @@ -368,7 +375,7 @@ sminloc0_4_r16 (gfc_array_i4 * const restrict retarray, index_type n; GFC_INTEGER_4 *dest; - if (*mask) + if (mask == NULL || *mask) { minloc0_4_r16 (retarray, array, back); return; diff --git a/libgfortran/generated/minloc0_4_r4.c b/libgfortran/generated/minloc0_4_r4.c index e94599b0dd0..52d04b4794a 100644 --- a/libgfortran/generated/minloc0_4_r4.c +++ b/libgfortran/generated/minloc0_4_r4.c @@ -198,6 +198,13 @@ mminloc0_4_r4 (gfc_array_i4 * const restrict retarray, index_type n; int mask_kind; + + if (mask == NULL) + { + minloc0_4_r4 (retarray, array, back); + return; + } + rank = GFC_DESCRIPTOR_RANK (array); if (rank <= 0) runtime_error ("Rank of array needs to be > 0"); @@ -368,7 +375,7 @@ sminloc0_4_r4 (gfc_array_i4 * const restrict retarray, index_type n; GFC_INTEGER_4 *dest; - if (*mask) + if (mask == NULL || *mask) { minloc0_4_r4 (retarray, array, back); return; diff --git a/libgfortran/generated/minloc0_4_r8.c b/libgfortran/generated/minloc0_4_r8.c index 520889063e7..1a7f5cb02a0 100644 --- a/libgfortran/generated/minloc0_4_r8.c +++ b/libgfortran/generated/minloc0_4_r8.c @@ -198,6 +198,13 @@ mminloc0_4_r8 (gfc_array_i4 * const restrict retarray, index_type n; int mask_kind; + + if (mask == NULL) + { + minloc0_4_r8 (retarray, array, back); + return; + } + rank = GFC_DESCRIPTOR_RANK (array); if (rank <= 0) runtime_error ("Rank of array needs to be > 0"); @@ -368,7 +375,7 @@ sminloc0_4_r8 (gfc_array_i4 * const restrict retarray, index_type n; GFC_INTEGER_4 *dest; - if (*mask) + if (mask == NULL || *mask) { minloc0_4_r8 (retarray, array, back); return; diff --git a/libgfortran/generated/minloc0_4_s1.c b/libgfortran/generated/minloc0_4_s1.c index c2615d2829e..79e7e7da858 100644 --- a/libgfortran/generated/minloc0_4_s1.c +++ b/libgfortran/generated/minloc0_4_s1.c @@ -174,6 +174,16 @@ mminloc0_4_s1 (gfc_array_i4 * const restrict retarray, index_type n; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + minloc0_4_s1 (retarray, array, back, len); +#else + minloc0_4_s1 (retarray, array, len); +#endif + return; + } + rank = GFC_DESCRIPTOR_RANK (array); if (rank <= 0) runtime_error ("Rank of array needs to be > 0"); @@ -304,7 +314,7 @@ sminloc0_4_s1 (gfc_array_i4 * const restrict retarray, index_type n; GFC_INTEGER_4 *dest; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG minloc0_4_s1 (retarray, array, back, len); diff --git a/libgfortran/generated/minloc0_4_s4.c b/libgfortran/generated/minloc0_4_s4.c index 5568cdbf4a3..e1e0344cc05 100644 --- a/libgfortran/generated/minloc0_4_s4.c +++ b/libgfortran/generated/minloc0_4_s4.c @@ -174,6 +174,16 @@ mminloc0_4_s4 (gfc_array_i4 * const restrict retarray, index_type n; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + minloc0_4_s4 (retarray, array, back, len); +#else + minloc0_4_s4 (retarray, array, len); +#endif + return; + } + rank = GFC_DESCRIPTOR_RANK (array); if (rank <= 0) runtime_error ("Rank of array needs to be > 0"); @@ -304,7 +314,7 @@ sminloc0_4_s4 (gfc_array_i4 * const restrict retarray, index_type n; GFC_INTEGER_4 *dest; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG minloc0_4_s4 (retarray, array, back, len); diff --git a/libgfortran/generated/minloc0_8_i1.c b/libgfortran/generated/minloc0_8_i1.c index bd2f2838f35..31525c333d7 100644 --- a/libgfortran/generated/minloc0_8_i1.c +++ b/libgfortran/generated/minloc0_8_i1.c @@ -198,6 +198,13 @@ mminloc0_8_i1 (gfc_array_i8 * const restrict retarray, index_type n; int mask_kind; + + if (mask == NULL) + { + minloc0_8_i1 (retarray, array, back); + return; + } + rank = GFC_DESCRIPTOR_RANK (array); if (rank <= 0) runtime_error ("Rank of array needs to be > 0"); @@ -368,7 +375,7 @@ sminloc0_8_i1 (gfc_array_i8 * const restrict retarray, index_type n; GFC_INTEGER_8 *dest; - if (*mask) + if (mask == NULL || *mask) { minloc0_8_i1 (retarray, array, back); return; diff --git a/libgfortran/generated/minloc0_8_i16.c b/libgfortran/generated/minloc0_8_i16.c index cf364b6a298..c17cfc0735b 100644 --- a/libgfortran/generated/minloc0_8_i16.c +++ b/libgfortran/generated/minloc0_8_i16.c @@ -198,6 +198,13 @@ mminloc0_8_i16 (gfc_array_i8 * const restrict retarray, index_type n; int mask_kind; + + if (mask == NULL) + { + minloc0_8_i16 (retarray, array, back); + return; + } + rank = GFC_DESCRIPTOR_RANK (array); if (rank <= 0) runtime_error ("Rank of array needs to be > 0"); @@ -368,7 +375,7 @@ sminloc0_8_i16 (gfc_array_i8 * const restrict retarray, index_type n; GFC_INTEGER_8 *dest; - if (*mask) + if (mask == NULL || *mask) { minloc0_8_i16 (retarray, array, back); return; diff --git a/libgfortran/generated/minloc0_8_i2.c b/libgfortran/generated/minloc0_8_i2.c index 244b7ee5b93..bb0ec3a176f 100644 --- a/libgfortran/generated/minloc0_8_i2.c +++ b/libgfortran/generated/minloc0_8_i2.c @@ -198,6 +198,13 @@ mminloc0_8_i2 (gfc_array_i8 * const restrict retarray, index_type n; int mask_kind; + + if (mask == NULL) + { + minloc0_8_i2 (retarray, array, back); + return; + } + rank = GFC_DESCRIPTOR_RANK (array); if (rank <= 0) runtime_error ("Rank of array needs to be > 0"); @@ -368,7 +375,7 @@ sminloc0_8_i2 (gfc_array_i8 * const restrict retarray, index_type n; GFC_INTEGER_8 *dest; - if (*mask) + if (mask == NULL || *mask) { minloc0_8_i2 (retarray, array, back); return; diff --git a/libgfortran/generated/minloc0_8_i4.c b/libgfortran/generated/minloc0_8_i4.c index 9d703d8df3a..fe4427f668d 100644 --- a/libgfortran/generated/minloc0_8_i4.c +++ b/libgfortran/generated/minloc0_8_i4.c @@ -198,6 +198,13 @@ mminloc0_8_i4 (gfc_array_i8 * const restrict retarray, index_type n; int mask_kind; + + if (mask == NULL) + { + minloc0_8_i4 (retarray, array, back); + return; + } + rank = GFC_DESCRIPTOR_RANK (array); if (rank <= 0) runtime_error ("Rank of array needs to be > 0"); @@ -368,7 +375,7 @@ sminloc0_8_i4 (gfc_array_i8 * const restrict retarray, index_type n; GFC_INTEGER_8 *dest; - if (*mask) + if (mask == NULL || *mask) { minloc0_8_i4 (retarray, array, back); return; diff --git a/libgfortran/generated/minloc0_8_i8.c b/libgfortran/generated/minloc0_8_i8.c index 2307c87f4d3..ee61838a846 100644 --- a/libgfortran/generated/minloc0_8_i8.c +++ b/libgfortran/generated/minloc0_8_i8.c @@ -198,6 +198,13 @@ mminloc0_8_i8 (gfc_array_i8 * const restrict retarray, index_type n; int mask_kind; + + if (mask == NULL) + { + minloc0_8_i8 (retarray, array, back); + return; + } + rank = GFC_DESCRIPTOR_RANK (array); if (rank <= 0) runtime_error ("Rank of array needs to be > 0"); @@ -368,7 +375,7 @@ sminloc0_8_i8 (gfc_array_i8 * const restrict retarray, index_type n; GFC_INTEGER_8 *dest; - if (*mask) + if (mask == NULL || *mask) { minloc0_8_i8 (retarray, array, back); return; diff --git a/libgfortran/generated/minloc0_8_r10.c b/libgfortran/generated/minloc0_8_r10.c index 5fe99969924..07fdaf4b82a 100644 --- a/libgfortran/generated/minloc0_8_r10.c +++ b/libgfortran/generated/minloc0_8_r10.c @@ -198,6 +198,13 @@ mminloc0_8_r10 (gfc_array_i8 * const restrict retarray, index_type n; int mask_kind; + + if (mask == NULL) + { + minloc0_8_r10 (retarray, array, back); + return; + } + rank = GFC_DESCRIPTOR_RANK (array); if (rank <= 0) runtime_error ("Rank of array needs to be > 0"); @@ -368,7 +375,7 @@ sminloc0_8_r10 (gfc_array_i8 * const restrict retarray, index_type n; GFC_INTEGER_8 *dest; - if (*mask) + if (mask == NULL || *mask) { minloc0_8_r10 (retarray, array, back); return; diff --git a/libgfortran/generated/minloc0_8_r16.c b/libgfortran/generated/minloc0_8_r16.c index d6c7318409e..489cb3509b3 100644 --- a/libgfortran/generated/minloc0_8_r16.c +++ b/libgfortran/generated/minloc0_8_r16.c @@ -198,6 +198,13 @@ mminloc0_8_r16 (gfc_array_i8 * const restrict retarray, index_type n; int mask_kind; + + if (mask == NULL) + { + minloc0_8_r16 (retarray, array, back); + return; + } + rank = GFC_DESCRIPTOR_RANK (array); if (rank <= 0) runtime_error ("Rank of array needs to be > 0"); @@ -368,7 +375,7 @@ sminloc0_8_r16 (gfc_array_i8 * const restrict retarray, index_type n; GFC_INTEGER_8 *dest; - if (*mask) + if (mask == NULL || *mask) { minloc0_8_r16 (retarray, array, back); return; diff --git a/libgfortran/generated/minloc0_8_r4.c b/libgfortran/generated/minloc0_8_r4.c index 4a7e163078f..781ebc17674 100644 --- a/libgfortran/generated/minloc0_8_r4.c +++ b/libgfortran/generated/minloc0_8_r4.c @@ -198,6 +198,13 @@ mminloc0_8_r4 (gfc_array_i8 * const restrict retarray, index_type n; int mask_kind; + + if (mask == NULL) + { + minloc0_8_r4 (retarray, array, back); + return; + } + rank = GFC_DESCRIPTOR_RANK (array); if (rank <= 0) runtime_error ("Rank of array needs to be > 0"); @@ -368,7 +375,7 @@ sminloc0_8_r4 (gfc_array_i8 * const restrict retarray, index_type n; GFC_INTEGER_8 *dest; - if (*mask) + if (mask == NULL || *mask) { minloc0_8_r4 (retarray, array, back); return; diff --git a/libgfortran/generated/minloc0_8_r8.c b/libgfortran/generated/minloc0_8_r8.c index fefd0e72ab7..823babd5bde 100644 --- a/libgfortran/generated/minloc0_8_r8.c +++ b/libgfortran/generated/minloc0_8_r8.c @@ -198,6 +198,13 @@ mminloc0_8_r8 (gfc_array_i8 * const restrict retarray, index_type n; int mask_kind; + + if (mask == NULL) + { + minloc0_8_r8 (retarray, array, back); + return; + } + rank = GFC_DESCRIPTOR_RANK (array); if (rank <= 0) runtime_error ("Rank of array needs to be > 0"); @@ -368,7 +375,7 @@ sminloc0_8_r8 (gfc_array_i8 * const restrict retarray, index_type n; GFC_INTEGER_8 *dest; - if (*mask) + if (mask == NULL || *mask) { minloc0_8_r8 (retarray, array, back); return; diff --git a/libgfortran/generated/minloc0_8_s1.c b/libgfortran/generated/minloc0_8_s1.c index e22f4f9fe99..0768abceb90 100644 --- a/libgfortran/generated/minloc0_8_s1.c +++ b/libgfortran/generated/minloc0_8_s1.c @@ -174,6 +174,16 @@ mminloc0_8_s1 (gfc_array_i8 * const restrict retarray, index_type n; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + minloc0_8_s1 (retarray, array, back, len); +#else + minloc0_8_s1 (retarray, array, len); +#endif + return; + } + rank = GFC_DESCRIPTOR_RANK (array); if (rank <= 0) runtime_error ("Rank of array needs to be > 0"); @@ -304,7 +314,7 @@ sminloc0_8_s1 (gfc_array_i8 * const restrict retarray, index_type n; GFC_INTEGER_8 *dest; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG minloc0_8_s1 (retarray, array, back, len); diff --git a/libgfortran/generated/minloc0_8_s4.c b/libgfortran/generated/minloc0_8_s4.c index 52ca0571ce3..6e49c1f94bb 100644 --- a/libgfortran/generated/minloc0_8_s4.c +++ b/libgfortran/generated/minloc0_8_s4.c @@ -174,6 +174,16 @@ mminloc0_8_s4 (gfc_array_i8 * const restrict retarray, index_type n; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + minloc0_8_s4 (retarray, array, back, len); +#else + minloc0_8_s4 (retarray, array, len); +#endif + return; + } + rank = GFC_DESCRIPTOR_RANK (array); if (rank <= 0) runtime_error ("Rank of array needs to be > 0"); @@ -304,7 +314,7 @@ sminloc0_8_s4 (gfc_array_i8 * const restrict retarray, index_type n; GFC_INTEGER_8 *dest; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG minloc0_8_s4 (retarray, array, back, len); diff --git a/libgfortran/generated/minloc1_16_i1.c b/libgfortran/generated/minloc1_16_i1.c index 5e6a604d9a6..796cc6802e3 100644 --- a/libgfortran/generated/minloc1_16_i1.c +++ b/libgfortran/generated/minloc1_16_i1.c @@ -258,6 +258,16 @@ mminloc1_16_i1 (gfc_array_i16 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + minloc1_16_i1 (retarray, array, pdim, back); +#else + minloc1_16_i1 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -480,7 +490,7 @@ sminloc1_16_i1 (gfc_array_i16 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG minloc1_16_i1 (retarray, array, pdim, back); diff --git a/libgfortran/generated/minloc1_16_i16.c b/libgfortran/generated/minloc1_16_i16.c index 2ba76f8c0b5..47daa2a2270 100644 --- a/libgfortran/generated/minloc1_16_i16.c +++ b/libgfortran/generated/minloc1_16_i16.c @@ -258,6 +258,16 @@ mminloc1_16_i16 (gfc_array_i16 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + minloc1_16_i16 (retarray, array, pdim, back); +#else + minloc1_16_i16 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -480,7 +490,7 @@ sminloc1_16_i16 (gfc_array_i16 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG minloc1_16_i16 (retarray, array, pdim, back); diff --git a/libgfortran/generated/minloc1_16_i2.c b/libgfortran/generated/minloc1_16_i2.c index fad47c2cff5..db7b2b257a5 100644 --- a/libgfortran/generated/minloc1_16_i2.c +++ b/libgfortran/generated/minloc1_16_i2.c @@ -258,6 +258,16 @@ mminloc1_16_i2 (gfc_array_i16 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + minloc1_16_i2 (retarray, array, pdim, back); +#else + minloc1_16_i2 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -480,7 +490,7 @@ sminloc1_16_i2 (gfc_array_i16 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG minloc1_16_i2 (retarray, array, pdim, back); diff --git a/libgfortran/generated/minloc1_16_i4.c b/libgfortran/generated/minloc1_16_i4.c index 5be21143cd2..7a5a69dc494 100644 --- a/libgfortran/generated/minloc1_16_i4.c +++ b/libgfortran/generated/minloc1_16_i4.c @@ -258,6 +258,16 @@ mminloc1_16_i4 (gfc_array_i16 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + minloc1_16_i4 (retarray, array, pdim, back); +#else + minloc1_16_i4 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -480,7 +490,7 @@ sminloc1_16_i4 (gfc_array_i16 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG minloc1_16_i4 (retarray, array, pdim, back); diff --git a/libgfortran/generated/minloc1_16_i8.c b/libgfortran/generated/minloc1_16_i8.c index d1fa3ff9730..270ee87736e 100644 --- a/libgfortran/generated/minloc1_16_i8.c +++ b/libgfortran/generated/minloc1_16_i8.c @@ -258,6 +258,16 @@ mminloc1_16_i8 (gfc_array_i16 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + minloc1_16_i8 (retarray, array, pdim, back); +#else + minloc1_16_i8 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -480,7 +490,7 @@ sminloc1_16_i8 (gfc_array_i16 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG minloc1_16_i8 (retarray, array, pdim, back); diff --git a/libgfortran/generated/minloc1_16_r10.c b/libgfortran/generated/minloc1_16_r10.c index d09b078bf70..e1b8900d8ec 100644 --- a/libgfortran/generated/minloc1_16_r10.c +++ b/libgfortran/generated/minloc1_16_r10.c @@ -258,6 +258,16 @@ mminloc1_16_r10 (gfc_array_i16 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + minloc1_16_r10 (retarray, array, pdim, back); +#else + minloc1_16_r10 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -480,7 +490,7 @@ sminloc1_16_r10 (gfc_array_i16 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG minloc1_16_r10 (retarray, array, pdim, back); diff --git a/libgfortran/generated/minloc1_16_r16.c b/libgfortran/generated/minloc1_16_r16.c index 356d789398d..813137c321b 100644 --- a/libgfortran/generated/minloc1_16_r16.c +++ b/libgfortran/generated/minloc1_16_r16.c @@ -258,6 +258,16 @@ mminloc1_16_r16 (gfc_array_i16 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + minloc1_16_r16 (retarray, array, pdim, back); +#else + minloc1_16_r16 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -480,7 +490,7 @@ sminloc1_16_r16 (gfc_array_i16 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG minloc1_16_r16 (retarray, array, pdim, back); diff --git a/libgfortran/generated/minloc1_16_r4.c b/libgfortran/generated/minloc1_16_r4.c index 2783b802014..c6909d6319c 100644 --- a/libgfortran/generated/minloc1_16_r4.c +++ b/libgfortran/generated/minloc1_16_r4.c @@ -258,6 +258,16 @@ mminloc1_16_r4 (gfc_array_i16 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + minloc1_16_r4 (retarray, array, pdim, back); +#else + minloc1_16_r4 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -480,7 +490,7 @@ sminloc1_16_r4 (gfc_array_i16 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG minloc1_16_r4 (retarray, array, pdim, back); diff --git a/libgfortran/generated/minloc1_16_r8.c b/libgfortran/generated/minloc1_16_r8.c index f9c46b04ba4..1b83991940c 100644 --- a/libgfortran/generated/minloc1_16_r8.c +++ b/libgfortran/generated/minloc1_16_r8.c @@ -258,6 +258,16 @@ mminloc1_16_r8 (gfc_array_i16 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + minloc1_16_r8 (retarray, array, pdim, back); +#else + minloc1_16_r8 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -480,7 +490,7 @@ sminloc1_16_r8 (gfc_array_i16 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG minloc1_16_r8 (retarray, array, pdim, back); diff --git a/libgfortran/generated/minloc1_16_s1.c b/libgfortran/generated/minloc1_16_s1.c index b0cb8bea16c..990ead0dd59 100644 --- a/libgfortran/generated/minloc1_16_s1.c +++ b/libgfortran/generated/minloc1_16_s1.c @@ -241,6 +241,16 @@ mminloc1_16_s1 (gfc_array_i16 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + minloc1_16_s1 (retarray, array, pdim, back, string_len); +#else + minloc1_16_s1 (retarray, array, pdim, string_len); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -436,7 +446,7 @@ sminloc1_16_s1 (gfc_array_i16 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG minloc1_16_s1 (retarray, array, pdim, back, string_len); diff --git a/libgfortran/generated/minloc1_16_s4.c b/libgfortran/generated/minloc1_16_s4.c index b4222627369..c5a7e977bc1 100644 --- a/libgfortran/generated/minloc1_16_s4.c +++ b/libgfortran/generated/minloc1_16_s4.c @@ -241,6 +241,16 @@ mminloc1_16_s4 (gfc_array_i16 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + minloc1_16_s4 (retarray, array, pdim, back, string_len); +#else + minloc1_16_s4 (retarray, array, pdim, string_len); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -436,7 +446,7 @@ sminloc1_16_s4 (gfc_array_i16 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG minloc1_16_s4 (retarray, array, pdim, back, string_len); diff --git a/libgfortran/generated/minloc1_4_i1.c b/libgfortran/generated/minloc1_4_i1.c index 92496affb00..61ab0fa9b61 100644 --- a/libgfortran/generated/minloc1_4_i1.c +++ b/libgfortran/generated/minloc1_4_i1.c @@ -258,6 +258,16 @@ mminloc1_4_i1 (gfc_array_i4 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + minloc1_4_i1 (retarray, array, pdim, back); +#else + minloc1_4_i1 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -480,7 +490,7 @@ sminloc1_4_i1 (gfc_array_i4 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG minloc1_4_i1 (retarray, array, pdim, back); diff --git a/libgfortran/generated/minloc1_4_i16.c b/libgfortran/generated/minloc1_4_i16.c index c0b91cf5f26..38b1141c5ce 100644 --- a/libgfortran/generated/minloc1_4_i16.c +++ b/libgfortran/generated/minloc1_4_i16.c @@ -258,6 +258,16 @@ mminloc1_4_i16 (gfc_array_i4 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + minloc1_4_i16 (retarray, array, pdim, back); +#else + minloc1_4_i16 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -480,7 +490,7 @@ sminloc1_4_i16 (gfc_array_i4 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG minloc1_4_i16 (retarray, array, pdim, back); diff --git a/libgfortran/generated/minloc1_4_i2.c b/libgfortran/generated/minloc1_4_i2.c index 4defa8d6a1d..3bd83909f81 100644 --- a/libgfortran/generated/minloc1_4_i2.c +++ b/libgfortran/generated/minloc1_4_i2.c @@ -258,6 +258,16 @@ mminloc1_4_i2 (gfc_array_i4 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + minloc1_4_i2 (retarray, array, pdim, back); +#else + minloc1_4_i2 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -480,7 +490,7 @@ sminloc1_4_i2 (gfc_array_i4 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG minloc1_4_i2 (retarray, array, pdim, back); diff --git a/libgfortran/generated/minloc1_4_i4.c b/libgfortran/generated/minloc1_4_i4.c index 5bf3ec1e444..3e04578b8b6 100644 --- a/libgfortran/generated/minloc1_4_i4.c +++ b/libgfortran/generated/minloc1_4_i4.c @@ -258,6 +258,16 @@ mminloc1_4_i4 (gfc_array_i4 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + minloc1_4_i4 (retarray, array, pdim, back); +#else + minloc1_4_i4 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -480,7 +490,7 @@ sminloc1_4_i4 (gfc_array_i4 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG minloc1_4_i4 (retarray, array, pdim, back); diff --git a/libgfortran/generated/minloc1_4_i8.c b/libgfortran/generated/minloc1_4_i8.c index c676fcc62c0..5c4921d9bd5 100644 --- a/libgfortran/generated/minloc1_4_i8.c +++ b/libgfortran/generated/minloc1_4_i8.c @@ -258,6 +258,16 @@ mminloc1_4_i8 (gfc_array_i4 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + minloc1_4_i8 (retarray, array, pdim, back); +#else + minloc1_4_i8 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -480,7 +490,7 @@ sminloc1_4_i8 (gfc_array_i4 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG minloc1_4_i8 (retarray, array, pdim, back); diff --git a/libgfortran/generated/minloc1_4_r10.c b/libgfortran/generated/minloc1_4_r10.c index 167f268436b..a1305ee3621 100644 --- a/libgfortran/generated/minloc1_4_r10.c +++ b/libgfortran/generated/minloc1_4_r10.c @@ -258,6 +258,16 @@ mminloc1_4_r10 (gfc_array_i4 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + minloc1_4_r10 (retarray, array, pdim, back); +#else + minloc1_4_r10 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -480,7 +490,7 @@ sminloc1_4_r10 (gfc_array_i4 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG minloc1_4_r10 (retarray, array, pdim, back); diff --git a/libgfortran/generated/minloc1_4_r16.c b/libgfortran/generated/minloc1_4_r16.c index df2fc90ab72..914f3c52329 100644 --- a/libgfortran/generated/minloc1_4_r16.c +++ b/libgfortran/generated/minloc1_4_r16.c @@ -258,6 +258,16 @@ mminloc1_4_r16 (gfc_array_i4 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + minloc1_4_r16 (retarray, array, pdim, back); +#else + minloc1_4_r16 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -480,7 +490,7 @@ sminloc1_4_r16 (gfc_array_i4 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG minloc1_4_r16 (retarray, array, pdim, back); diff --git a/libgfortran/generated/minloc1_4_r4.c b/libgfortran/generated/minloc1_4_r4.c index 4d2a0b0edf7..4b816d7828a 100644 --- a/libgfortran/generated/minloc1_4_r4.c +++ b/libgfortran/generated/minloc1_4_r4.c @@ -258,6 +258,16 @@ mminloc1_4_r4 (gfc_array_i4 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + minloc1_4_r4 (retarray, array, pdim, back); +#else + minloc1_4_r4 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -480,7 +490,7 @@ sminloc1_4_r4 (gfc_array_i4 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG minloc1_4_r4 (retarray, array, pdim, back); diff --git a/libgfortran/generated/minloc1_4_r8.c b/libgfortran/generated/minloc1_4_r8.c index 04fcfecab8b..1da3aae901a 100644 --- a/libgfortran/generated/minloc1_4_r8.c +++ b/libgfortran/generated/minloc1_4_r8.c @@ -258,6 +258,16 @@ mminloc1_4_r8 (gfc_array_i4 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + minloc1_4_r8 (retarray, array, pdim, back); +#else + minloc1_4_r8 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -480,7 +490,7 @@ sminloc1_4_r8 (gfc_array_i4 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG minloc1_4_r8 (retarray, array, pdim, back); diff --git a/libgfortran/generated/minloc1_4_s1.c b/libgfortran/generated/minloc1_4_s1.c index 0a52c34c259..ce653008aee 100644 --- a/libgfortran/generated/minloc1_4_s1.c +++ b/libgfortran/generated/minloc1_4_s1.c @@ -241,6 +241,16 @@ mminloc1_4_s1 (gfc_array_i4 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + minloc1_4_s1 (retarray, array, pdim, back, string_len); +#else + minloc1_4_s1 (retarray, array, pdim, string_len); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -436,7 +446,7 @@ sminloc1_4_s1 (gfc_array_i4 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG minloc1_4_s1 (retarray, array, pdim, back, string_len); diff --git a/libgfortran/generated/minloc1_4_s4.c b/libgfortran/generated/minloc1_4_s4.c index 0338f6ae547..ef418088854 100644 --- a/libgfortran/generated/minloc1_4_s4.c +++ b/libgfortran/generated/minloc1_4_s4.c @@ -241,6 +241,16 @@ mminloc1_4_s4 (gfc_array_i4 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + minloc1_4_s4 (retarray, array, pdim, back, string_len); +#else + minloc1_4_s4 (retarray, array, pdim, string_len); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -436,7 +446,7 @@ sminloc1_4_s4 (gfc_array_i4 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG minloc1_4_s4 (retarray, array, pdim, back, string_len); diff --git a/libgfortran/generated/minloc1_8_i1.c b/libgfortran/generated/minloc1_8_i1.c index 3eec08fedd3..fd8c89e9a71 100644 --- a/libgfortran/generated/minloc1_8_i1.c +++ b/libgfortran/generated/minloc1_8_i1.c @@ -258,6 +258,16 @@ mminloc1_8_i1 (gfc_array_i8 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + minloc1_8_i1 (retarray, array, pdim, back); +#else + minloc1_8_i1 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -480,7 +490,7 @@ sminloc1_8_i1 (gfc_array_i8 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG minloc1_8_i1 (retarray, array, pdim, back); diff --git a/libgfortran/generated/minloc1_8_i16.c b/libgfortran/generated/minloc1_8_i16.c index dbe4d3281eb..9b746c46b28 100644 --- a/libgfortran/generated/minloc1_8_i16.c +++ b/libgfortran/generated/minloc1_8_i16.c @@ -258,6 +258,16 @@ mminloc1_8_i16 (gfc_array_i8 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + minloc1_8_i16 (retarray, array, pdim, back); +#else + minloc1_8_i16 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -480,7 +490,7 @@ sminloc1_8_i16 (gfc_array_i8 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG minloc1_8_i16 (retarray, array, pdim, back); diff --git a/libgfortran/generated/minloc1_8_i2.c b/libgfortran/generated/minloc1_8_i2.c index f20d1387523..50b85690787 100644 --- a/libgfortran/generated/minloc1_8_i2.c +++ b/libgfortran/generated/minloc1_8_i2.c @@ -258,6 +258,16 @@ mminloc1_8_i2 (gfc_array_i8 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + minloc1_8_i2 (retarray, array, pdim, back); +#else + minloc1_8_i2 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -480,7 +490,7 @@ sminloc1_8_i2 (gfc_array_i8 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG minloc1_8_i2 (retarray, array, pdim, back); diff --git a/libgfortran/generated/minloc1_8_i4.c b/libgfortran/generated/minloc1_8_i4.c index 9d83cc09464..a92af86a4bf 100644 --- a/libgfortran/generated/minloc1_8_i4.c +++ b/libgfortran/generated/minloc1_8_i4.c @@ -258,6 +258,16 @@ mminloc1_8_i4 (gfc_array_i8 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + minloc1_8_i4 (retarray, array, pdim, back); +#else + minloc1_8_i4 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -480,7 +490,7 @@ sminloc1_8_i4 (gfc_array_i8 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG minloc1_8_i4 (retarray, array, pdim, back); diff --git a/libgfortran/generated/minloc1_8_i8.c b/libgfortran/generated/minloc1_8_i8.c index b5d0eac33e5..9c7d926bb5d 100644 --- a/libgfortran/generated/minloc1_8_i8.c +++ b/libgfortran/generated/minloc1_8_i8.c @@ -258,6 +258,16 @@ mminloc1_8_i8 (gfc_array_i8 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + minloc1_8_i8 (retarray, array, pdim, back); +#else + minloc1_8_i8 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -480,7 +490,7 @@ sminloc1_8_i8 (gfc_array_i8 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG minloc1_8_i8 (retarray, array, pdim, back); diff --git a/libgfortran/generated/minloc1_8_r10.c b/libgfortran/generated/minloc1_8_r10.c index a990567be77..bb3098609b9 100644 --- a/libgfortran/generated/minloc1_8_r10.c +++ b/libgfortran/generated/minloc1_8_r10.c @@ -258,6 +258,16 @@ mminloc1_8_r10 (gfc_array_i8 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + minloc1_8_r10 (retarray, array, pdim, back); +#else + minloc1_8_r10 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -480,7 +490,7 @@ sminloc1_8_r10 (gfc_array_i8 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG minloc1_8_r10 (retarray, array, pdim, back); diff --git a/libgfortran/generated/minloc1_8_r16.c b/libgfortran/generated/minloc1_8_r16.c index 7fd75339bd4..20ca3528b47 100644 --- a/libgfortran/generated/minloc1_8_r16.c +++ b/libgfortran/generated/minloc1_8_r16.c @@ -258,6 +258,16 @@ mminloc1_8_r16 (gfc_array_i8 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + minloc1_8_r16 (retarray, array, pdim, back); +#else + minloc1_8_r16 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -480,7 +490,7 @@ sminloc1_8_r16 (gfc_array_i8 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG minloc1_8_r16 (retarray, array, pdim, back); diff --git a/libgfortran/generated/minloc1_8_r4.c b/libgfortran/generated/minloc1_8_r4.c index eadf4e1a7a7..eebb153602a 100644 --- a/libgfortran/generated/minloc1_8_r4.c +++ b/libgfortran/generated/minloc1_8_r4.c @@ -258,6 +258,16 @@ mminloc1_8_r4 (gfc_array_i8 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + minloc1_8_r4 (retarray, array, pdim, back); +#else + minloc1_8_r4 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -480,7 +490,7 @@ sminloc1_8_r4 (gfc_array_i8 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG minloc1_8_r4 (retarray, array, pdim, back); diff --git a/libgfortran/generated/minloc1_8_r8.c b/libgfortran/generated/minloc1_8_r8.c index 97c77967cd1..58b3cda79f3 100644 --- a/libgfortran/generated/minloc1_8_r8.c +++ b/libgfortran/generated/minloc1_8_r8.c @@ -258,6 +258,16 @@ mminloc1_8_r8 (gfc_array_i8 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + minloc1_8_r8 (retarray, array, pdim, back); +#else + minloc1_8_r8 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -480,7 +490,7 @@ sminloc1_8_r8 (gfc_array_i8 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG minloc1_8_r8 (retarray, array, pdim, back); diff --git a/libgfortran/generated/minloc1_8_s1.c b/libgfortran/generated/minloc1_8_s1.c index 2c387902ab9..f53a5906150 100644 --- a/libgfortran/generated/minloc1_8_s1.c +++ b/libgfortran/generated/minloc1_8_s1.c @@ -241,6 +241,16 @@ mminloc1_8_s1 (gfc_array_i8 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + minloc1_8_s1 (retarray, array, pdim, back, string_len); +#else + minloc1_8_s1 (retarray, array, pdim, string_len); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -436,7 +446,7 @@ sminloc1_8_s1 (gfc_array_i8 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG minloc1_8_s1 (retarray, array, pdim, back, string_len); diff --git a/libgfortran/generated/minloc1_8_s4.c b/libgfortran/generated/minloc1_8_s4.c index 59d2d6f1141..ff4ee8c0690 100644 --- a/libgfortran/generated/minloc1_8_s4.c +++ b/libgfortran/generated/minloc1_8_s4.c @@ -241,6 +241,16 @@ mminloc1_8_s4 (gfc_array_i8 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + minloc1_8_s4 (retarray, array, pdim, back, string_len); +#else + minloc1_8_s4 (retarray, array, pdim, string_len); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -436,7 +446,7 @@ sminloc1_8_s4 (gfc_array_i8 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG minloc1_8_s4 (retarray, array, pdim, back, string_len); diff --git a/libgfortran/generated/minval0_s1.c b/libgfortran/generated/minval0_s1.c index a15b8357d85..4f1d57e318a 100644 --- a/libgfortran/generated/minval0_s1.c +++ b/libgfortran/generated/minval0_s1.c @@ -150,6 +150,12 @@ mminval0_s1 (GFC_UINTEGER_1 * const restrict ret, index_type n; int mask_kind; + if (mask == NULL) + { + minval0_s1 (ret, xlen, array, len); + return; + } + rank = GFC_DESCRIPTOR_RANK (array); if (rank <= 0) runtime_error ("Rank of array needs to be > 0"); @@ -247,7 +253,7 @@ sminval0_s1 (GFC_UINTEGER_1 * restrict ret, GFC_LOGICAL_4 *mask, gfc_charlen_type len) { - if (*mask) + if (mask == NULL || *mask) { minval0_s1 (ret, xlen, array, len); return; diff --git a/libgfortran/generated/minval0_s4.c b/libgfortran/generated/minval0_s4.c index 2b3c332edd2..7a516b14f8e 100644 --- a/libgfortran/generated/minval0_s4.c +++ b/libgfortran/generated/minval0_s4.c @@ -150,6 +150,12 @@ mminval0_s4 (GFC_UINTEGER_4 * const restrict ret, index_type n; int mask_kind; + if (mask == NULL) + { + minval0_s4 (ret, xlen, array, len); + return; + } + rank = GFC_DESCRIPTOR_RANK (array); if (rank <= 0) runtime_error ("Rank of array needs to be > 0"); @@ -247,7 +253,7 @@ sminval0_s4 (GFC_UINTEGER_4 * restrict ret, GFC_LOGICAL_4 *mask, gfc_charlen_type len) { - if (*mask) + if (mask == NULL || *mask) { minval0_s4 (ret, xlen, array, len); return; diff --git a/libgfortran/generated/minval1_s1.c b/libgfortran/generated/minval1_s1.c index be747be30e1..20ffa2c303f 100644 --- a/libgfortran/generated/minval1_s1.c +++ b/libgfortran/generated/minval1_s1.c @@ -239,6 +239,12 @@ mminval1_s1 (gfc_array_s1 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { + minval1_s1 (retarray, xlen, array, pdim, string_len); + return; + } + assert (xlen == string_len); dim = (*pdim) - 1; @@ -436,7 +442,7 @@ sminval1_s1 (gfc_array_s1 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { minval1_s1 (retarray, xlen, array, pdim, string_len); return; diff --git a/libgfortran/generated/minval1_s4.c b/libgfortran/generated/minval1_s4.c index abd449e5ec0..4e97192b619 100644 --- a/libgfortran/generated/minval1_s4.c +++ b/libgfortran/generated/minval1_s4.c @@ -239,6 +239,12 @@ mminval1_s4 (gfc_array_s4 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { + minval1_s4 (retarray, xlen, array, pdim, string_len); + return; + } + assert (xlen == string_len); dim = (*pdim) - 1; @@ -436,7 +442,7 @@ sminval1_s4 (gfc_array_s4 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { minval1_s4 (retarray, xlen, array, pdim, string_len); return; diff --git a/libgfortran/generated/minval_i1.c b/libgfortran/generated/minval_i1.c index 36e126d1f81..a72d29dbb5d 100644 --- a/libgfortran/generated/minval_i1.c +++ b/libgfortran/generated/minval_i1.c @@ -234,6 +234,16 @@ mminval_i1 (gfc_array_i1 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + minval_i1 (retarray, array, pdim, back); +#else + minval_i1 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -441,7 +451,7 @@ sminval_i1 (gfc_array_i1 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG minval_i1 (retarray, array, pdim, back); diff --git a/libgfortran/generated/minval_i16.c b/libgfortran/generated/minval_i16.c index def692704c5..e08b7eedbd0 100644 --- a/libgfortran/generated/minval_i16.c +++ b/libgfortran/generated/minval_i16.c @@ -234,6 +234,16 @@ mminval_i16 (gfc_array_i16 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + minval_i16 (retarray, array, pdim, back); +#else + minval_i16 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -441,7 +451,7 @@ sminval_i16 (gfc_array_i16 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG minval_i16 (retarray, array, pdim, back); diff --git a/libgfortran/generated/minval_i2.c b/libgfortran/generated/minval_i2.c index d6f2a1e2d08..50961c0e08e 100644 --- a/libgfortran/generated/minval_i2.c +++ b/libgfortran/generated/minval_i2.c @@ -234,6 +234,16 @@ mminval_i2 (gfc_array_i2 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + minval_i2 (retarray, array, pdim, back); +#else + minval_i2 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -441,7 +451,7 @@ sminval_i2 (gfc_array_i2 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG minval_i2 (retarray, array, pdim, back); diff --git a/libgfortran/generated/minval_i4.c b/libgfortran/generated/minval_i4.c index ae622098ff0..018fcc4f29f 100644 --- a/libgfortran/generated/minval_i4.c +++ b/libgfortran/generated/minval_i4.c @@ -234,6 +234,16 @@ mminval_i4 (gfc_array_i4 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + minval_i4 (retarray, array, pdim, back); +#else + minval_i4 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -441,7 +451,7 @@ sminval_i4 (gfc_array_i4 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG minval_i4 (retarray, array, pdim, back); diff --git a/libgfortran/generated/minval_i8.c b/libgfortran/generated/minval_i8.c index 76edbd68a10..4258efe6448 100644 --- a/libgfortran/generated/minval_i8.c +++ b/libgfortran/generated/minval_i8.c @@ -234,6 +234,16 @@ mminval_i8 (gfc_array_i8 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + minval_i8 (retarray, array, pdim, back); +#else + minval_i8 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -441,7 +451,7 @@ sminval_i8 (gfc_array_i8 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG minval_i8 (retarray, array, pdim, back); diff --git a/libgfortran/generated/minval_r10.c b/libgfortran/generated/minval_r10.c index caf1e27e93b..365503338c3 100644 --- a/libgfortran/generated/minval_r10.c +++ b/libgfortran/generated/minval_r10.c @@ -234,6 +234,16 @@ mminval_r10 (gfc_array_r10 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + minval_r10 (retarray, array, pdim, back); +#else + minval_r10 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -441,7 +451,7 @@ sminval_r10 (gfc_array_r10 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG minval_r10 (retarray, array, pdim, back); diff --git a/libgfortran/generated/minval_r16.c b/libgfortran/generated/minval_r16.c index fedbe68624c..bb9a9950510 100644 --- a/libgfortran/generated/minval_r16.c +++ b/libgfortran/generated/minval_r16.c @@ -234,6 +234,16 @@ mminval_r16 (gfc_array_r16 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + minval_r16 (retarray, array, pdim, back); +#else + minval_r16 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -441,7 +451,7 @@ sminval_r16 (gfc_array_r16 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG minval_r16 (retarray, array, pdim, back); diff --git a/libgfortran/generated/minval_r4.c b/libgfortran/generated/minval_r4.c index 0fe7ba1df6e..4ad8ecab3c8 100644 --- a/libgfortran/generated/minval_r4.c +++ b/libgfortran/generated/minval_r4.c @@ -234,6 +234,16 @@ mminval_r4 (gfc_array_r4 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + minval_r4 (retarray, array, pdim, back); +#else + minval_r4 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -441,7 +451,7 @@ sminval_r4 (gfc_array_r4 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG minval_r4 (retarray, array, pdim, back); diff --git a/libgfortran/generated/minval_r8.c b/libgfortran/generated/minval_r8.c index 85503c3b2b2..9d39bf61e36 100644 --- a/libgfortran/generated/minval_r8.c +++ b/libgfortran/generated/minval_r8.c @@ -234,6 +234,16 @@ mminval_r8 (gfc_array_r8 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + minval_r8 (retarray, array, pdim, back); +#else + minval_r8 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -441,7 +451,7 @@ sminval_r8 (gfc_array_r8 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG minval_r8 (retarray, array, pdim, back); diff --git a/libgfortran/generated/product_c10.c b/libgfortran/generated/product_c10.c index 4cf81aca6af..71a255a61c6 100644 --- a/libgfortran/generated/product_c10.c +++ b/libgfortran/generated/product_c10.c @@ -220,6 +220,16 @@ mproduct_c10 (gfc_array_c10 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + product_c10 (retarray, array, pdim, back); +#else + product_c10 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -399,7 +409,7 @@ sproduct_c10 (gfc_array_c10 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG product_c10 (retarray, array, pdim, back); diff --git a/libgfortran/generated/product_c16.c b/libgfortran/generated/product_c16.c index 5567379d88b..9cb59caf214 100644 --- a/libgfortran/generated/product_c16.c +++ b/libgfortran/generated/product_c16.c @@ -220,6 +220,16 @@ mproduct_c16 (gfc_array_c16 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + product_c16 (retarray, array, pdim, back); +#else + product_c16 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -399,7 +409,7 @@ sproduct_c16 (gfc_array_c16 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG product_c16 (retarray, array, pdim, back); diff --git a/libgfortran/generated/product_c4.c b/libgfortran/generated/product_c4.c index c9439c847f1..bfcb6b71f4b 100644 --- a/libgfortran/generated/product_c4.c +++ b/libgfortran/generated/product_c4.c @@ -220,6 +220,16 @@ mproduct_c4 (gfc_array_c4 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + product_c4 (retarray, array, pdim, back); +#else + product_c4 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -399,7 +409,7 @@ sproduct_c4 (gfc_array_c4 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG product_c4 (retarray, array, pdim, back); diff --git a/libgfortran/generated/product_c8.c b/libgfortran/generated/product_c8.c index 94017ac5c65..705b13167ff 100644 --- a/libgfortran/generated/product_c8.c +++ b/libgfortran/generated/product_c8.c @@ -220,6 +220,16 @@ mproduct_c8 (gfc_array_c8 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + product_c8 (retarray, array, pdim, back); +#else + product_c8 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -399,7 +409,7 @@ sproduct_c8 (gfc_array_c8 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG product_c8 (retarray, array, pdim, back); diff --git a/libgfortran/generated/product_i1.c b/libgfortran/generated/product_i1.c index 62fe44cdd22..0b406780ec7 100644 --- a/libgfortran/generated/product_i1.c +++ b/libgfortran/generated/product_i1.c @@ -220,6 +220,16 @@ mproduct_i1 (gfc_array_i1 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + product_i1 (retarray, array, pdim, back); +#else + product_i1 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -399,7 +409,7 @@ sproduct_i1 (gfc_array_i1 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG product_i1 (retarray, array, pdim, back); diff --git a/libgfortran/generated/product_i16.c b/libgfortran/generated/product_i16.c index 487a8f2679f..6896a0ef0be 100644 --- a/libgfortran/generated/product_i16.c +++ b/libgfortran/generated/product_i16.c @@ -220,6 +220,16 @@ mproduct_i16 (gfc_array_i16 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + product_i16 (retarray, array, pdim, back); +#else + product_i16 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -399,7 +409,7 @@ sproduct_i16 (gfc_array_i16 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG product_i16 (retarray, array, pdim, back); diff --git a/libgfortran/generated/product_i2.c b/libgfortran/generated/product_i2.c index 1a7cf7ea695..a6423da006d 100644 --- a/libgfortran/generated/product_i2.c +++ b/libgfortran/generated/product_i2.c @@ -220,6 +220,16 @@ mproduct_i2 (gfc_array_i2 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + product_i2 (retarray, array, pdim, back); +#else + product_i2 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -399,7 +409,7 @@ sproduct_i2 (gfc_array_i2 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG product_i2 (retarray, array, pdim, back); diff --git a/libgfortran/generated/product_i4.c b/libgfortran/generated/product_i4.c index e70209bfe14..fd1919ce981 100644 --- a/libgfortran/generated/product_i4.c +++ b/libgfortran/generated/product_i4.c @@ -220,6 +220,16 @@ mproduct_i4 (gfc_array_i4 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + product_i4 (retarray, array, pdim, back); +#else + product_i4 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -399,7 +409,7 @@ sproduct_i4 (gfc_array_i4 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG product_i4 (retarray, array, pdim, back); diff --git a/libgfortran/generated/product_i8.c b/libgfortran/generated/product_i8.c index 0af1d0a01cd..5cfeabc05d8 100644 --- a/libgfortran/generated/product_i8.c +++ b/libgfortran/generated/product_i8.c @@ -220,6 +220,16 @@ mproduct_i8 (gfc_array_i8 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + product_i8 (retarray, array, pdim, back); +#else + product_i8 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -399,7 +409,7 @@ sproduct_i8 (gfc_array_i8 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG product_i8 (retarray, array, pdim, back); diff --git a/libgfortran/generated/product_r10.c b/libgfortran/generated/product_r10.c index df92b05d770..28f3072aa5c 100644 --- a/libgfortran/generated/product_r10.c +++ b/libgfortran/generated/product_r10.c @@ -220,6 +220,16 @@ mproduct_r10 (gfc_array_r10 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + product_r10 (retarray, array, pdim, back); +#else + product_r10 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -399,7 +409,7 @@ sproduct_r10 (gfc_array_r10 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG product_r10 (retarray, array, pdim, back); diff --git a/libgfortran/generated/product_r16.c b/libgfortran/generated/product_r16.c index 45f3419d851..b10027f2bae 100644 --- a/libgfortran/generated/product_r16.c +++ b/libgfortran/generated/product_r16.c @@ -220,6 +220,16 @@ mproduct_r16 (gfc_array_r16 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + product_r16 (retarray, array, pdim, back); +#else + product_r16 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -399,7 +409,7 @@ sproduct_r16 (gfc_array_r16 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG product_r16 (retarray, array, pdim, back); diff --git a/libgfortran/generated/product_r4.c b/libgfortran/generated/product_r4.c index 3aaff50e4a6..e09a43a0b21 100644 --- a/libgfortran/generated/product_r4.c +++ b/libgfortran/generated/product_r4.c @@ -220,6 +220,16 @@ mproduct_r4 (gfc_array_r4 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + product_r4 (retarray, array, pdim, back); +#else + product_r4 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -399,7 +409,7 @@ sproduct_r4 (gfc_array_r4 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG product_r4 (retarray, array, pdim, back); diff --git a/libgfortran/generated/product_r8.c b/libgfortran/generated/product_r8.c index ba407bf27f9..20068edd356 100644 --- a/libgfortran/generated/product_r8.c +++ b/libgfortran/generated/product_r8.c @@ -220,6 +220,16 @@ mproduct_r8 (gfc_array_r8 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + product_r8 (retarray, array, pdim, back); +#else + product_r8 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -399,7 +409,7 @@ sproduct_r8 (gfc_array_r8 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG product_r8 (retarray, array, pdim, back); diff --git a/libgfortran/generated/sum_c10.c b/libgfortran/generated/sum_c10.c index e20b4edb373..d7f1e73435a 100644 --- a/libgfortran/generated/sum_c10.c +++ b/libgfortran/generated/sum_c10.c @@ -220,6 +220,16 @@ msum_c10 (gfc_array_c10 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + sum_c10 (retarray, array, pdim, back); +#else + sum_c10 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -399,7 +409,7 @@ ssum_c10 (gfc_array_c10 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG sum_c10 (retarray, array, pdim, back); diff --git a/libgfortran/generated/sum_c16.c b/libgfortran/generated/sum_c16.c index 7ae41a37d61..d1414d31a6c 100644 --- a/libgfortran/generated/sum_c16.c +++ b/libgfortran/generated/sum_c16.c @@ -220,6 +220,16 @@ msum_c16 (gfc_array_c16 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + sum_c16 (retarray, array, pdim, back); +#else + sum_c16 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -399,7 +409,7 @@ ssum_c16 (gfc_array_c16 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG sum_c16 (retarray, array, pdim, back); diff --git a/libgfortran/generated/sum_c4.c b/libgfortran/generated/sum_c4.c index 2b50f2f3ee2..d15a7173699 100644 --- a/libgfortran/generated/sum_c4.c +++ b/libgfortran/generated/sum_c4.c @@ -220,6 +220,16 @@ msum_c4 (gfc_array_c4 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + sum_c4 (retarray, array, pdim, back); +#else + sum_c4 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -399,7 +409,7 @@ ssum_c4 (gfc_array_c4 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG sum_c4 (retarray, array, pdim, back); diff --git a/libgfortran/generated/sum_c8.c b/libgfortran/generated/sum_c8.c index 5b41f546aa4..55454e06d62 100644 --- a/libgfortran/generated/sum_c8.c +++ b/libgfortran/generated/sum_c8.c @@ -220,6 +220,16 @@ msum_c8 (gfc_array_c8 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + sum_c8 (retarray, array, pdim, back); +#else + sum_c8 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -399,7 +409,7 @@ ssum_c8 (gfc_array_c8 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG sum_c8 (retarray, array, pdim, back); diff --git a/libgfortran/generated/sum_i1.c b/libgfortran/generated/sum_i1.c index 3ff4ddc2769..4b6d277b835 100644 --- a/libgfortran/generated/sum_i1.c +++ b/libgfortran/generated/sum_i1.c @@ -220,6 +220,16 @@ msum_i1 (gfc_array_i1 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + sum_i1 (retarray, array, pdim, back); +#else + sum_i1 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -399,7 +409,7 @@ ssum_i1 (gfc_array_i1 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG sum_i1 (retarray, array, pdim, back); diff --git a/libgfortran/generated/sum_i16.c b/libgfortran/generated/sum_i16.c index 8027fe4c605..25bb2ad4091 100644 --- a/libgfortran/generated/sum_i16.c +++ b/libgfortran/generated/sum_i16.c @@ -220,6 +220,16 @@ msum_i16 (gfc_array_i16 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + sum_i16 (retarray, array, pdim, back); +#else + sum_i16 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -399,7 +409,7 @@ ssum_i16 (gfc_array_i16 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG sum_i16 (retarray, array, pdim, back); diff --git a/libgfortran/generated/sum_i2.c b/libgfortran/generated/sum_i2.c index b0467ec1395..b6816d85fac 100644 --- a/libgfortran/generated/sum_i2.c +++ b/libgfortran/generated/sum_i2.c @@ -220,6 +220,16 @@ msum_i2 (gfc_array_i2 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + sum_i2 (retarray, array, pdim, back); +#else + sum_i2 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -399,7 +409,7 @@ ssum_i2 (gfc_array_i2 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG sum_i2 (retarray, array, pdim, back); diff --git a/libgfortran/generated/sum_i4.c b/libgfortran/generated/sum_i4.c index 0f5f83672ca..63e807e87e7 100644 --- a/libgfortran/generated/sum_i4.c +++ b/libgfortran/generated/sum_i4.c @@ -220,6 +220,16 @@ msum_i4 (gfc_array_i4 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + sum_i4 (retarray, array, pdim, back); +#else + sum_i4 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -399,7 +409,7 @@ ssum_i4 (gfc_array_i4 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG sum_i4 (retarray, array, pdim, back); diff --git a/libgfortran/generated/sum_i8.c b/libgfortran/generated/sum_i8.c index 9c5c17b70c2..a4557f69180 100644 --- a/libgfortran/generated/sum_i8.c +++ b/libgfortran/generated/sum_i8.c @@ -220,6 +220,16 @@ msum_i8 (gfc_array_i8 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + sum_i8 (retarray, array, pdim, back); +#else + sum_i8 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -399,7 +409,7 @@ ssum_i8 (gfc_array_i8 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG sum_i8 (retarray, array, pdim, back); diff --git a/libgfortran/generated/sum_r10.c b/libgfortran/generated/sum_r10.c index 201facc89e7..863bcb681d8 100644 --- a/libgfortran/generated/sum_r10.c +++ b/libgfortran/generated/sum_r10.c @@ -220,6 +220,16 @@ msum_r10 (gfc_array_r10 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + sum_r10 (retarray, array, pdim, back); +#else + sum_r10 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -399,7 +409,7 @@ ssum_r10 (gfc_array_r10 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG sum_r10 (retarray, array, pdim, back); diff --git a/libgfortran/generated/sum_r16.c b/libgfortran/generated/sum_r16.c index 161a5f30961..f7e98f3083f 100644 --- a/libgfortran/generated/sum_r16.c +++ b/libgfortran/generated/sum_r16.c @@ -220,6 +220,16 @@ msum_r16 (gfc_array_r16 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + sum_r16 (retarray, array, pdim, back); +#else + sum_r16 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -399,7 +409,7 @@ ssum_r16 (gfc_array_r16 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG sum_r16 (retarray, array, pdim, back); diff --git a/libgfortran/generated/sum_r4.c b/libgfortran/generated/sum_r4.c index 4228bde8be8..a4579103762 100644 --- a/libgfortran/generated/sum_r4.c +++ b/libgfortran/generated/sum_r4.c @@ -220,6 +220,16 @@ msum_r4 (gfc_array_r4 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + sum_r4 (retarray, array, pdim, back); +#else + sum_r4 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -399,7 +409,7 @@ ssum_r4 (gfc_array_r4 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG sum_r4 (retarray, array, pdim, back); diff --git a/libgfortran/generated/sum_r8.c b/libgfortran/generated/sum_r8.c index 8d3483287d4..4d1b5a0f9e8 100644 --- a/libgfortran/generated/sum_r8.c +++ b/libgfortran/generated/sum_r8.c @@ -220,6 +220,16 @@ msum_r8 (gfc_array_r8 * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + sum_r8 (retarray, array, pdim, back); +#else + sum_r8 (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -399,7 +409,7 @@ ssum_r8 (gfc_array_r8 * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG sum_r8 (retarray, array, pdim, back); diff --git a/libgfortran/m4/ifindloc0.m4 b/libgfortran/m4/ifindloc0.m4 index 94937f1ed20..75ec531620f 100644 --- a/libgfortran/m4/ifindloc0.m4 +++ b/libgfortran/m4/ifindloc0.m4 @@ -48,7 +48,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype.rank = 1; retarray->offset = 0; - retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4)); + retarray->base_addr = xmallocarray (rank, sizeof (index_type)); } else { @@ -179,7 +179,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype.rank = 1; retarray->offset = 0; - retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4)); + retarray->base_addr = xmallocarray (rank, sizeof (index_type)); } else { @@ -317,7 +317,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see index_type * restrict dest; index_type n; - if (*mask) + if (mask == NULL || *mask) { findloc0_'atype_code` (retarray, array, value, back'len_arg`); return; @@ -333,7 +333,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1); retarray->dtype.rank = 1; retarray->offset = 0; - retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4)); + retarray->base_addr = xmallocarray (rank, sizeof (index_type)); } else if (unlikely (compile_options.bounds_check)) { diff --git a/libgfortran/m4/ifindloc1.m4 b/libgfortran/m4/ifindloc1.m4 index 70638be793b..f4a709931d9 100644 --- a/libgfortran/m4/ifindloc1.m4 +++ b/libgfortran/m4/ifindloc1.m4 @@ -95,7 +95,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; - retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4)); + retarray->base_addr = xmallocarray (alloc_size, sizeof (index_type)); if (alloc_size == 0) { /* Make sure we have a zero-sized array. */ @@ -273,7 +273,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; - retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4)); + retarray->base_addr = xmallocarray (alloc_size, sizeof (index_type)); if (alloc_size == 0) { /* Make sure we have a zero-sized array. */ @@ -379,7 +379,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see index_type dim; bool continue_loop; - if (*mask) + if (mask == NULL || *mask) { findloc1_'atype_code`'` (retarray, array, value, pdim, back'len_arg`'`); return; @@ -436,7 +436,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]; - retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4)); + retarray->base_addr = xmallocarray (alloc_size, sizeof (index_type)); if (alloc_size == 0) { /* Make sure we have a zero-sized array. */ diff --git a/libgfortran/m4/ifindloc2.m4 b/libgfortran/m4/ifindloc2.m4 index ede704132af..d6d785112c2 100644 --- a/libgfortran/m4/ifindloc2.m4 +++ b/libgfortran/m4/ifindloc2.m4 @@ -117,7 +117,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see } 'header3`'` { - if (*mask) + if (mask == NULL || *mask) { return findloc2_'atype_code` (array, value, back, len_array, len_value); } diff --git a/libgfortran/m4/iforeach-s.m4 b/libgfortran/m4/iforeach-s.m4 index 19bb23bd4ee..b841d1519c5 100644 --- a/libgfortran/m4/iforeach-s.m4 +++ b/libgfortran/m4/iforeach-s.m4 @@ -135,6 +135,16 @@ m'name`'rtype_qual`_'atype_code` ('rtype` * const restrict retarray, index_type n; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + name`'rtype_qual`_'atype_code (retarray, array, back, len); +#else + name`'rtype_qual`_'atype_code (retarray, array, len); +#endif + return; + } + rank = GFC_DESCRIPTOR_RANK (array); if (rank <= 0) runtime_error ("Rank of array needs to be > 0"); @@ -261,7 +271,7 @@ void index_type n; 'rtype_name *dest; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG name`'rtype_qual`_'atype_code (retarray, array, back, len); diff --git a/libgfortran/m4/iforeach-s2.m4 b/libgfortran/m4/iforeach-s2.m4 index 19d016f7c65..63fde458ef1 100644 --- a/libgfortran/m4/iforeach-s2.m4 +++ b/libgfortran/m4/iforeach-s2.m4 @@ -116,6 +116,12 @@ void index_type n; int mask_kind; + if (mask == NULL) + { + name`'rtype_qual`_'atype_code (ret, xlen, array, len); + return; + } + rank = GFC_DESCRIPTOR_RANK (array); if (rank <= 0) runtime_error ("Rank of array needs to be > 0"); @@ -213,7 +219,7 @@ void GFC_LOGICAL_4 *mask, gfc_charlen_type len) { - if (*mask) + if (mask == NULL || *mask) { name`'rtype_qual`_'atype_code (ret, xlen, array, len); return; diff --git a/libgfortran/m4/iforeach.m4 b/libgfortran/m4/iforeach.m4 index dff9f8b9e10..ede4a7faf4a 100644 --- a/libgfortran/m4/iforeach.m4 +++ b/libgfortran/m4/iforeach.m4 @@ -123,6 +123,13 @@ void index_type n; int mask_kind; + + if (mask == NULL) + { + name`'rtype_qual`_'atype_code (retarray, array, back); + return; + } + rank = GFC_DESCRIPTOR_RANK (array); if (rank <= 0) runtime_error ("Rank of array needs to be > 0"); @@ -247,7 +254,7 @@ void index_type n; rtype_name *dest; - if (*mask) + if (mask == NULL || *mask) { name`'rtype_qual`_'atype_code (retarray, array, back); return; diff --git a/libgfortran/m4/ifunction-s.m4 b/libgfortran/m4/ifunction-s.m4 index 55d6b187e28..16615aa290f 100644 --- a/libgfortran/m4/ifunction-s.m4 +++ b/libgfortran/m4/ifunction-s.m4 @@ -222,6 +222,16 @@ m'name`'rtype_qual`_'atype_code` ('rtype` * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + name`'rtype_qual`_'atype_code (retarray, array, pdim, back, string_len); +#else + name`'rtype_qual`_'atype_code (retarray, array, pdim, string_len); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -400,7 +410,7 @@ s'name`'rtype_qual`_'atype_code` ('rtype` * const restrict retarray, index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG name`'rtype_qual`_'atype_code (retarray, array, pdim, back, string_len); diff --git a/libgfortran/m4/ifunction-s2.m4 b/libgfortran/m4/ifunction-s2.m4 index b4ce650e84a..4d31c208e05 100644 --- a/libgfortran/m4/ifunction-s2.m4 +++ b/libgfortran/m4/ifunction-s2.m4 @@ -225,6 +225,12 @@ void index_type mdelta; int mask_kind; + if (mask == NULL) + { + name`'rtype_qual`_'atype_code (retarray, xlen, array, pdim, string_len); + return; + } + assert (xlen == string_len); dim = (*pdim) - 1; @@ -408,7 +414,7 @@ void index_type dim; - if (*mask) + if (mask == NULL || *mask) { name`'rtype_qual`_'atype_code (retarray, xlen, array, pdim, string_len); return; diff --git a/libgfortran/m4/ifunction.m4 b/libgfortran/m4/ifunction.m4 index 3b8d7024a10..c64217ec5db 100644 --- a/libgfortran/m4/ifunction.m4 +++ b/libgfortran/m4/ifunction.m4 @@ -210,6 +210,16 @@ m'name`'rtype_qual`_'atype_code` ('rtype` * const restrict retarray, index_type mdelta; int mask_kind; + if (mask == NULL) + { +#ifdef HAVE_BACK_ARG + name`'rtype_qual`_'atype_code (retarray, array, pdim, back); +#else + name`'rtype_qual`_'atype_code (retarray, array, pdim); +#endif + return; + } + dim = (*pdim) - 1; rank = GFC_DESCRIPTOR_RANK (array) - 1; @@ -388,7 +398,7 @@ void index_type dim; - if (*mask) + if (mask == NULL || *mask) { #ifdef HAVE_BACK_ARG name`'rtype_qual`_'atype_code (retarray, array, pdim, back);