re PR fortran/79335 (Conditional jump or move depends on uninitialised in value ...
authorAndre Vehreschild <vehre@gcc.gnu.org>
Sun, 5 Feb 2017 13:05:10 +0000 (14:05 +0100)
committerAndre Vehreschild <vehre@gcc.gnu.org>
Sun, 5 Feb 2017 13:05:10 +0000 (14:05 +0100)
gcc/fortran/ChangeLog:

2017-02-05  Andre Vehreschild  <vehre@gcc.gnu.org>

PR fortran/79335
* trans-decl.c (generate_coarray_sym_init): Retrieve the symbol's
attributes before using them.

From-SVN: r245193

gcc/fortran/ChangeLog
gcc/fortran/trans-decl.c

index 601017dbfdd48d7030af38829bbf542a47d5ce43..222e91f15bb996b47ac2354fd66a3bff25f207f1 100644 (file)
@@ -1,3 +1,9 @@
+2017-02-05  Andre Vehreschild  <vehre@gcc.gnu.org>
+
+       PR fortran/79335
+       * trans-decl.c (generate_coarray_sym_init): Retrieve the symbol's
+       attributes before using them.
+
 2017-02-05  Andre Vehreschild  <vehre@gcc.gnu.org>
 
        PR fortran/78958
index 3e54e80a69a3b14711ca903a6dcc641a6db6b000..41b36a5949525b2b5503dec36964fe8428b90aee 100644 (file)
@@ -5128,6 +5128,16 @@ generate_coarray_sym_init (gfc_symbol *sym)
   else
     reg_type = GFC_CAF_COARRAY_STATIC;
 
+  /* Compile the symbol attribute.  */
+  if (sym->ts.type == BT_CLASS)
+    {
+      attr = CLASS_DATA (sym)->attr;
+      /* The pointer attribute is always set on classes, overwrite it with the
+        class_pointer attribute, which denotes the pointer for classes.  */
+      attr.pointer = attr.class_pointer;
+    }
+  else
+    attr = sym->attr;
   gfc_init_se (&se, NULL);
   desc = gfc_conv_scalar_to_descriptor (&se, decl, attr);
   gfc_add_block_to_block (&caf_init_block, &se.pre);