re PR fortran/83898 (ICE in gfc_conv_expr_descriptor, at fortran/trans-array.c:7181)
authorPaul Thomas <pault@gcc.gnu.org>
Tue, 23 Jan 2018 19:10:48 +0000 (19:10 +0000)
committerPaul Thomas <pault@gcc.gnu.org>
Tue, 23 Jan 2018 19:10:48 +0000 (19:10 +0000)
2018-23-01  Paul Thomas  <pault@gcc.gnu.org>

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

2018-23-01  Paul Thomas  <pault@gcc.gnu.org>

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

From-SVN: r256994

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

index f8a7c9a3a0b406aab071a92a4314ee812c8d54cf..f50d8a8b283696f2857275d1f6c87f6ef6066d6d 100644 (file)
@@ -1,3 +1,9 @@
+2018-23-01  Paul Thomas  <pault@gcc.gnu.org>
+
+       PR fortran/83898
+       * trans-stmt.c (trans_associate_var): Do not set cst_array_ctor
+       for characters.
+
 2018-01-22  Janne Blomqvist  <jb@gcc.gnu.org>
 
        PR 78534
index ff6e5914319303432536d1fec855c3692f5c59ad..df83a2b664769239e47a3b3e919614eb0e57c1ab 100644 (file)
@@ -1579,7 +1579,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 b7211ce8228008f79ebaa6acf148796ee7a43566..d6e6709077f8de078ef553323254644c60e4250a 100644 (file)
@@ -1,3 +1,8 @@
+2018-23-01  Paul Thomas  <pault@gcc.gnu.org>
+
+       PR fortran/83898
+       * gfortran.dg/associate_33.f03 : New test.
+
 2018-01-23  Martin Liska  <mliska@suse.cz>
 
        PR lto/81440
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