From: Michael Matz Date: Wed, 30 Mar 2011 17:31:54 +0000 (+0000) Subject: re PR fortran/47516 (testsuite failure: realloc_on_assign_2.f03 (with --disable-boots... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=83799a479c7da8eedeefd9a4d760cd923fc1e18c;p=gcc.git re PR fortran/47516 (testsuite failure: realloc_on_assign_2.f03 (with --disable-bootstrap)) PR fortran/47516 * trans-expr.c (realloc_lhs_loop_for_fcn_call): Take loop as parameter, don't use local variable. (gfc_trans_arrayfunc_assign): Adjust caller. From-SVN: r171736 --- diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 3ebca545f0a..b651ae235fd 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,10 @@ +2011-03-30 Michael Matz matz@suse.de> + + PR fortran/47516 + * trans-expr.c (realloc_lhs_loop_for_fcn_call): Take loop as parameter, + don't use local variable. + (gfc_trans_arrayfunc_assign): Adjust caller. + 2011-03-29 Janus Weil PR fortran/48095 diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c index da7cfba5981..41ee5eee931 100644 --- a/gcc/fortran/trans-expr.c +++ b/gcc/fortran/trans-expr.c @@ -5510,20 +5510,20 @@ arrayfunc_assign_needs_temporary (gfc_expr * expr1, gfc_expr * expr2) reallocatable assignments from extrinsic function calls. */ static void -realloc_lhs_loop_for_fcn_call (gfc_se *se, locus *where, gfc_ss **ss) +realloc_lhs_loop_for_fcn_call (gfc_se *se, locus *where, gfc_ss **ss, + gfc_loopinfo *loop) { - gfc_loopinfo loop; /* Signal that the function call should not be made by gfc_conv_loop_setup. */ se->ss->is_alloc_lhs = 1; - gfc_init_loopinfo (&loop); - gfc_add_ss_to_loop (&loop, *ss); - gfc_add_ss_to_loop (&loop, se->ss); - gfc_conv_ss_startstride (&loop); - gfc_conv_loop_setup (&loop, where); - gfc_copy_loopinfo_to_se (se, &loop); - gfc_add_block_to_block (&se->pre, &loop.pre); - gfc_add_block_to_block (&se->pre, &loop.post); + gfc_init_loopinfo (loop); + gfc_add_ss_to_loop (loop, *ss); + gfc_add_ss_to_loop (loop, se->ss); + gfc_conv_ss_startstride (loop); + gfc_conv_loop_setup (loop, where); + gfc_copy_loopinfo_to_se (se, loop); + gfc_add_block_to_block (&se->pre, &loop->pre); + gfc_add_block_to_block (&se->pre, &loop->post); se->ss->is_alloc_lhs = 0; } @@ -5591,6 +5591,7 @@ gfc_trans_arrayfunc_assign (gfc_expr * expr1, gfc_expr * expr2) gfc_se se; gfc_ss *ss; gfc_component *comp = NULL; + gfc_loopinfo loop; if (arrayfunc_assign_needs_temporary (expr1, expr2)) return NULL; @@ -5641,7 +5642,7 @@ gfc_trans_arrayfunc_assign (gfc_expr * expr1, gfc_expr * expr2) { if (!expr2->value.function.isym) { - realloc_lhs_loop_for_fcn_call (&se, &expr1->where, &ss); + realloc_lhs_loop_for_fcn_call (&se, &expr1->where, &ss, &loop); ss->is_alloc_lhs = 1; } else