http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57022



--- Comment #2 from janus at gcc dot gnu.org 2013-04-21 10:19:17 UTC ---

Draft patch which gets rid of the warnings for the test case:





Index: gcc/fortran/check.c

===================================================================

--- gcc/fortran/check.c    (revision 198108)

+++ gcc/fortran/check.c    (working copy)

@@ -4456,13 +4456,17 @@ gfc_calculate_transfer_sizes (gfc_expr *source, gf

     return false;



   /* Calculate the size of the source.  */

-  if (source->expr_type == EXPR_ARRAY

-      && !gfc_array_size (source, &tmp))

-    return false;

-

   *source_size = gfc_target_expr_size (source);

   if (*source_size == 0)

     return false;

+  

+  if (source->expr_type == EXPR_ARRAY || source->rank > 0)

+    {

+      if (!gfc_array_size (source, &tmp))

+    *source_size *= mpz_get_ui (tmp);

+      else

+    return false;

+    }



   mold_element = mold->expr_type == EXPR_ARRAY

          ? gfc_constructor_first (mold->value.constructor)->expr





Regtesting now ...

Reply via email to