===================================================================
@@ -4304,7 +4304,7 @@ done:
}
}
- /* The rest is just runtime bound checking. */
+ /* The rest is just runtime bounds checking. */
if (gfc_option.rtcheck & GFC_RTCHECK_BOUNDS)
{
stmtblock_t block;
@@ -4334,7 +4334,7 @@ done:
continue;
/* Catch allocatable lhs in f2003. */
- if (flag_realloc_lhs && ss->is_alloc_lhs)
+ if (flag_realloc_lhs && ss->no_bounds_check)
continue;
expr = ss_info->expr;
===================================================================
@@ -9982,12 +9982,15 @@ gfc_trans_assignment_1 (gfc_expr * expr1, gfc_expr
/* Walk the lhs. */
lss = gfc_walk_expr (expr1);
- if (gfc_is_reallocatable_lhs (expr1)
- && !(expr2->expr_type == EXPR_FUNCTION
- && expr2->value.function.isym != NULL
- && !(expr2->value.function.isym->elemental
- || expr2->value.function.isym->conversion)))
- lss->is_alloc_lhs = 1;
+ if (gfc_is_reallocatable_lhs (expr1))
+ {
+ lss->no_bounds_check = 1;
+ if (!(expr2->expr_type == EXPR_FUNCTION
+ && expr2->value.function.isym != NULL
+ && !(expr2->value.function.isym->elemental
+ || expr2->value.function.isym->conversion)))
+ lss->is_alloc_lhs = 1;
+ }
rss = NULL;
===================================================================
@@ -330,6 +330,7 @@ typedef struct gfc_ss
struct gfc_loopinfo *loop;
unsigned is_alloc_lhs:1;
+ unsigned no_bounds_check:1;
}
gfc_ss;
#define gfc_get_ss() XCNEW (gfc_ss)