]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR fortran/83898 (ICE in gfc_conv_expr_descriptor, at fortran/trans-array.c:7181)
authorPaul Thomas <pault@gcc.gnu.org>
Wed, 16 May 2018 10:41:48 +0000 (10:41 +0000)
committerPaul Thomas <pault@gcc.gnu.org>
Wed, 16 May 2018 10:41:48 +0000 (10:41 +0000)
2018-16-05  Paul Thomas  <pault@gcc.gnu.org>

PR fortran/83898
Backport from trunk
* trans-stmt.c (trans_associate_var): Do not set cst_array_ctor
for characters.

2018-16-05  Paul Thomas  <pault@gcc.gnu.org>

PR fortran/83898
Backport from trunk
* gfortran.dg/associate_33.f03 : New test.

From-SVN: r260284

gcc/fortran/ChangeLog
gcc/fortran/trans-stmt.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/associate_33.f03 [new file with mode: 0644]

index 2f13abb8732ee678b01a13ab21027cf7c852b1ba..e5674bdbce7e4309202da72b9f4944b5be19f152 100644 (file)
@@ -1,3 +1,10 @@
+2018-16-05  Paul Thomas  <pault@gcc.gnu.org>
+
+       PR fortran/83898
+       Backport from trunk
+       * trans-stmt.c (trans_associate_var): Do not set cst_array_ctor
+       for characters.
+
 2018-05-13  Paul Thomas  <pault@gcc.gnu.org>
 
        PR fortran/68846
index 45510bc51f73d2b3dc2fb21a6a7bdda374d576c8..58add0b5d9b23f26c49c49fc777b0fba8ca09225 100644 (file)
@@ -1541,7 +1541,8 @@ trans_associate_var (gfc_symbol *sym, gfc_wrapped_block *block)
 
       desc = sym->backend_decl;
       cst_array_ctor = e->expr_type == EXPR_ARRAY
-             && gfc_constant_array_constructor_p (e->value.constructor);
+             && gfc_constant_array_constructor_p (e->value.constructor)
+             && e->ts.type != BT_CHARACTER;
 
       /* If association is to an expression, evaluate it and create temporary.
         Otherwise, get descriptor of target for pointer assignment.  */
index 0a3cdbf0df584ddec915c2326769f1bfa777db84..4aa19625332dd48aeda38ffa36bba9289e67adf8 100644 (file)
@@ -1,3 +1,9 @@
+2018-16-05  Paul Thomas  <pault@gcc.gnu.org>
+
+       PR fortran/83898
+       Backport from trunk
+       * gfortran.dg/associate_33.f03 : New test.
+
 2018-05-13  Paul Thomas  <pault@gcc.gnu.org>
 
        PR fortran/68846
diff --git a/gcc/testsuite/gfortran.dg/associate_33.f03 b/gcc/testsuite/gfortran.dg/associate_33.f03
new file mode 100644 (file)
index 0000000..1f87b22
--- /dev/null
@@ -0,0 +1,11 @@
+! { dg-do run }
+!
+! Test the fix for PR83898.f90
+!
+! Contributed by G Steinmetz  <gscfq@t-online.de>
+!
+program p
+   associate (x => ['1','2'])
+      if (any (x .ne. ['1','2'])) call abort
+   end associate
+end