OSDN Git Service

2010-03-18 Paul Thomas <pault@gcc.gnu.org>
authorpault <pault@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 18 Mar 2010 21:23:35 +0000 (21:23 +0000)
committerMasaki Muranaka <monaka@monami-software.com>
Sun, 23 May 2010 05:13:24 +0000 (14:13 +0900)
        PR fortran/43039
        * trans-expr.c (conv_parent_component_references): Ensure that
'dt' has a backend_decl.

        PR fortran/43043
        * trans-expr.c (gfc_conv_structure): Ensure that the derived
type has a backend_decl.

        PR fortran/43044
        * resolve.c (resolve_global_procedure): Check that the 'cl'
structure is not NULL.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@157552 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/fortran/ChangeLog
gcc/fortran/resolve.c
gcc/fortran/trans-expr.c

index 231deaa..dc155fa 100644 (file)
@@ -1,3 +1,17 @@
+2010-03-18  Paul Thomas  <pault@gcc.gnu.org>
+
+        PR fortran/43039
+        * trans-expr.c (conv_parent_component_references): Ensure that
+       'dt' has a backend_decl.
+
+        PR fortran/43043
+        * trans-expr.c (gfc_conv_structure): Ensure that the derived
+       type has a backend_decl.
+
+        PR fortran/43044
+        * resolve.c (resolve_global_procedure): Check that the 'cl'
+       structure is not NULL.
+
 2010-03-18  Shujing Zhao  <pearly.zhao@oracle.com>
 
        * lang.opt (-ffixed-line-length-, ffree-line-length-): Remove
index a8b58d1..ce7140f 100644 (file)
@@ -1881,12 +1881,13 @@ resolve_global_procedure (gfc_symbol *sym, locus *where,
      
       /* Non-assumed length character functions.  */
       if (sym->attr.function && sym->ts.type == BT_CHARACTER
-         && gsym->ns->proc_name->ts.u.cl->length != NULL)
+           && gsym->ns->proc_name->ts.u.cl != NULL
+           && gsym->ns->proc_name->ts.u.cl->length != NULL)
        {
          gfc_charlen *cl = sym->ts.u.cl;
 
          if (!sym->attr.entry_master && sym->attr.if_source == IFSRC_UNKNOWN
-              && cl && cl->length && cl->length->expr_type != EXPR_CONSTANT)
+                && cl && cl->length && cl->length->expr_type != EXPR_CONSTANT)
            {
               gfc_error ("Nonconstant character-length function '%s' at %L "
                         "must have an explicit interface", sym->name,
index b7a296d..127e322 100644 (file)
@@ -4337,7 +4337,20 @@ gfc_conv_structure (gfc_se * se, gfc_expr * expr, int init)
       if (!c->expr || cm->attr.allocatable)
         continue;
 
-      if (strcmp (cm->name, "$size") == 0)
+      if (cm->ts.type == BT_CLASS)
+       {
+         gfc_component *data;
+         data = gfc_find_component (cm->ts.u.derived, "$data", true, true);
+         if (!data->backend_decl)
+           gfc_get_derived_type (cm->ts.u.derived);
+         val = gfc_conv_initializer (c->expr, &cm->ts,
+                                     TREE_TYPE (data->backend_decl),
+                                     data->attr.dimension,
+                                     data->attr.pointer);
+
+         CONSTRUCTOR_APPEND_ELT (v, data->backend_decl, val);
+       }
+      else if (strcmp (cm->name, "$size") == 0)
        {
          val = TYPE_SIZE_UNIT (gfc_get_derived_type (cm->ts.u.derived));
          CONSTRUCTOR_APPEND_ELT (v, cm->backend_decl, val);