]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR fortran/50420 ([Coarray] lcobound doesn't accept coarray subcomponents)
authorMikael Morin <mikael@gcc.gnu.org>
Tue, 18 Oct 2011 15:17:29 +0000 (15:17 +0000)
committerMikael Morin <mikael@gcc.gnu.org>
Tue, 18 Oct 2011 15:17:29 +0000 (15:17 +0000)
PR fortran/50420
* trans.c (gfc_build_array_ref): If type is not an array, check that
there is nothing to do, and do nothing.

From-SVN: r180152

gcc/fortran/ChangeLog
gcc/fortran/trans.c

index f8105b1b0e884cad1d3eff2db1049b1a731a65bb..f7a793f056cfa7f32624b09c0905daa88c8d20de 100644 (file)
@@ -1,3 +1,9 @@
+2011-10-18  Mikael Morin  <mikael@gcc.gnu.org>
+
+       PR fortran/50420
+       * trans.c (gfc_build_array_ref): If type is not an array, check that
+       there is nothing to do, and do nothing.
+
 2011-10-18  Mikael Morin  <mikael@gcc.gnu.org>
 
        PR fortran/50420
index 0176aece2b87e57e95574411600682a977bb3cc1..88bd389c545661b417c9c9cc3f9c9831c240db72 100644 (file)
@@ -323,7 +323,14 @@ gfc_build_array_ref (tree base, tree offset, tree decl)
       return fold_convert (TYPE_MAIN_VARIANT (type), base);
     }
 
-  gcc_assert (TREE_CODE (type) == ARRAY_TYPE);
+  /* Scalar coarray, there is nothing to do.  */
+  if (TREE_CODE (type) != ARRAY_TYPE)
+    {
+      gcc_assert (decl == NULL_TREE);
+      gcc_assert (integer_zerop (offset));
+      return base;
+    }
+
   type = TREE_TYPE (type);
 
   if (DECL_P (base))