diff options
author | Tobias Burnus <burnus@net-b.de> | 2013-06-21 23:24:59 +0200 |
---|---|---|
committer | Tobias Burnus <burnus@gcc.gnu.org> | 2013-06-21 23:24:59 +0200 |
commit | 6f556b07c95e830c322c1ba5ffaa2bbdaab51423 (patch) | |
tree | de666856b53a7c1867fe9025f590cfc193062abc /gcc/fortran/trans-expr.c | |
parent | 2ce86d2eb54f42359291f388a833fa05b6f1bf19 (diff) | |
download | gcc-6f556b07c95e830c322c1ba5ffaa2bbdaab51423.zip gcc-6f556b07c95e830c322c1ba5ffaa2bbdaab51423.tar.gz gcc-6f556b07c95e830c322c1ba5ffaa2bbdaab51423.tar.bz2 |
trans-array.c (gfc_alloc_allocatable_for_assignment): Allocate at least one byte.
2013-06-21 Tobias Burnus <burnus@net-b.de>
* trans-array.c (gfc_alloc_allocatable_for_assignment): Allocate
at least one byte.
* trans-expr.c (alloc_scalar_allocatable_for_assignment): Ditto.
2013-06-21 Tobias Burnus <burnus@net-b.de>
* gfortran.dg/realloc_on_assign_18.f90: New.
From-SVN: r200320
Diffstat (limited to 'gcc/fortran/trans-expr.c')
-rw-r--r-- | gcc/fortran/trans-expr.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c index bd8886c..56dc766 100644 --- a/gcc/fortran/trans-expr.c +++ b/gcc/fortran/trans-expr.c @@ -7574,6 +7574,9 @@ alloc_scalar_allocatable_for_assignment (stmtblock_t *block, size_in_bytes = size; } + size_in_bytes = fold_build2_loc (input_location, MAX_EXPR, size_type_node, + size_in_bytes, size_one_node); + if (expr1->ts.type == BT_DERIVED && expr1->ts.u.derived->attr.alloc_comp) { tmp = build_call_expr_loc (input_location, |