diff options
author | Paul Thomas <pault@gcc.gnu.org> | 2021-03-15 09:32:52 +0000 |
---|---|---|
committer | Paul Thomas <pault@gcc.gnu.org> | 2021-03-15 09:32:52 +0000 |
commit | 21ced2776a117924e52f6aab8b41afb613fef0e7 (patch) | |
tree | 4449d2ebb5e4e9e6fc0a88f6efe7fcf1d586225b /gcc/fortran/trans-stmt.c | |
parent | f20fe2cb213dffba47ec1b62c625590b5bbe50d7 (diff) | |
download | gcc-21ced2776a117924e52f6aab8b41afb613fef0e7.zip gcc-21ced2776a117924e52f6aab8b41afb613fef0e7.tar.gz gcc-21ced2776a117924e52f6aab8b41afb613fef0e7.tar.bz2 |
Fortran: Fix problem with allocate initialization [PR99545].
2021-03-15 Paul Thomas <pault@gcc.gnu.org>
gcc/fortran/ChangeLog
PR fortran/99545
* trans-stmt.c (gfc_trans_allocate): Mark the initialization
assignment by setting init_flag.
gcc/testsuite/ChangeLog
PR fortran/99545
* gfortran.dg/pr99545.f90: New test.
Diffstat (limited to 'gcc/fortran/trans-stmt.c')
-rw-r--r-- | gcc/fortran/trans-stmt.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/fortran/trans-stmt.c b/gcc/fortran/trans-stmt.c index 547468f..7cbdef7 100644 --- a/gcc/fortran/trans-stmt.c +++ b/gcc/fortran/trans-stmt.c @@ -7001,7 +7001,7 @@ gfc_trans_allocate (gfc_code * code) gfc_expr *init_expr = gfc_expr_to_initialize (expr); gfc_expr *rhs = e3rhs ? e3rhs : gfc_copy_expr (code->expr3); flag_realloc_lhs = 0; - tmp = gfc_trans_assignment (init_expr, rhs, false, false, true, + tmp = gfc_trans_assignment (init_expr, rhs, true, false, true, false); flag_realloc_lhs = realloc_lhs; /* Free the expression allocated for init_expr. */ |