aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran
diff options
context:
space:
mode:
authorPaul Thomas <pault@gcc.gnu.org>2018-09-19 17:44:36 +0000
committerPaul Thomas <pault@gcc.gnu.org>2018-09-19 17:44:36 +0000
commitad9fe5f344c6ade92a8efab3202be356c94d5733 (patch)
treeff35a61b077f024034777efaf7e2826d8307eda1 /gcc/fortran
parentebdf17cb73df8e9759c9fd6d0afc0329c0072cd8 (diff)
downloadgcc-ad9fe5f344c6ade92a8efab3202be356c94d5733.zip
gcc-ad9fe5f344c6ade92a8efab3202be356c94d5733.tar.gz
gcc-ad9fe5f344c6ade92a8efab3202be356c94d5733.tar.bz2
re PR fortran/84109 (ICE in adjustl on allocatable array of strings)
2018-09-19 Paul Thomas <pault@gcc.gnu.org> PR fortran/84109 * trans-expr.c (gfc_trans_assignment_1): The rse.pre for the assignment of deferred character intrinsic elemental function results to a realocatable lhs must not be added to the exterior block if they are array valued but must go to the loop body. 2018-09-19 Paul Thomas <pault@gcc.gnu.org> PR fortran/84109 * gfortran.dg/elemental_function_3.f90 : New test. From-SVN: r264427
Diffstat (limited to 'gcc/fortran')
-rw-r--r--gcc/fortran/ChangeLog8
-rw-r--r--gcc/fortran/trans-expr.c9
2 files changed, 13 insertions, 4 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 4557bc2..15f060b 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,11 @@
+2018-09-19 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/84109
+ * trans-expr.c (gfc_trans_assignment_1): The rse.pre for the
+ assignment of deferred character intrinsic elemental function
+ results to a realocatable lhs must not be added to the exterior
+ block if they are array valued but must go to the loop body.
+
2018-09-18 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/29550
diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c
index 144c666..53b4359 100644
--- a/gcc/fortran/trans-expr.c
+++ b/gcc/fortran/trans-expr.c
@@ -10279,18 +10279,19 @@ gfc_trans_assignment_1 (gfc_expr * expr1, gfc_expr * expr2, bool init_flag,
parameter available to the caller; gfortran saves it in the .mod files.
NOTE ALSO: The concatenation operation generates a temporary pointer,
whose allocation must go to the innermost loop.
- NOTE ALSO (2): A character conversion may generate a temporary, too. */
+ NOTE ALSO (2): Elemental functions may generate a temporary, too. */
if (flag_realloc_lhs
&& expr2->ts.type == BT_CHARACTER && expr1->ts.deferred
&& !(lss != gfc_ss_terminator
+ && rss != gfc_ss_terminator
&& ((expr2->expr_type == EXPR_FUNCTION
&& expr2->value.function.esym != NULL
&& expr2->value.function.esym->attr.elemental)
- || (expr2->expr_type == EXPR_OP
- && expr2->value.op.op == INTRINSIC_CONCAT)
|| (expr2->expr_type == EXPR_FUNCTION
&& expr2->value.function.isym != NULL
- && expr2->value.function.isym->id == GFC_ISYM_CONVERSION))))
+ && expr2->value.function.isym->elemental)
+ || (expr2->expr_type == EXPR_OP
+ && expr2->value.op.op == INTRINSIC_CONCAT))))
gfc_add_block_to_block (&block, &rse.pre);
/* Nullify the allocatable components corresponding to those of the lhs