aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/trans-array.c
diff options
context:
space:
mode:
authorAndre Vehreschild <vehre@gcc.gnu.org>2015-11-08 18:37:42 +0100
committerAndre Vehreschild <vehre@gcc.gnu.org>2015-11-08 18:37:42 +0100
commit3e4d188a5fe6df5994af7ee800614305afb7f8f7 (patch)
tree0dd2be76bd06a73d4408b68fe1cf35636d5f4734 /gcc/fortran/trans-array.c
parent28bc117f586fbb15b887e6517e2b08330fec91c0 (diff)
downloadgcc-3e4d188a5fe6df5994af7ee800614305afb7f8f7.zip
gcc-3e4d188a5fe6df5994af7ee800614305afb7f8f7.tar.gz
gcc-3e4d188a5fe6df5994af7ee800614305afb7f8f7.tar.bz2
re PR fortran/68218 (ALLOCATE with size given by a module function)
gcc/fortran/ChangeLog: 2015-11-08 Andre Vehreschild <vehre@gcc.gnu.org> PR fortran/68218 * trans-array.c (gfc_array_init_size): Add gfc_evaluate_now() when array spec in allocate is a function call. gcc/testsuite/ChangeLog: 2015-11-08 Andre Vehreschild <vehre@gcc.gnu.org> PR fortran/68218 * gfortran.dg/allocate_with_arrayspec_1.f90: New test. From-SVN: r229956
Diffstat (limited to 'gcc/fortran/trans-array.c')
-rw-r--r--gcc/fortran/trans-array.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c
index 6bbf8cc..e28a5ce 100644
--- a/gcc/fortran/trans-array.c
+++ b/gcc/fortran/trans-array.c
@@ -5150,6 +5150,8 @@ gfc_array_init_size (tree descriptor, int rank, int corank, tree * poffset,
gcc_assert (ubound);
gfc_conv_expr_type (&se, ubound, gfc_array_index_type);
gfc_add_block_to_block (pblock, &se.pre);
+ if (ubound->expr_type == EXPR_FUNCTION)
+ se.expr = gfc_evaluate_now (se.expr, pblock);
}
gfc_conv_descriptor_ubound_set (descriptor_block, descriptor,
gfc_rank_cst[n], se.expr);