OSDN Git Service

2010-04-06 Tobias Burnus <burnus@net-b.de>
authorburnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 6 Apr 2010 12:46:19 +0000 (12:46 +0000)
committerMasaki Muranaka <monaka@monami-software.com>
Sun, 23 May 2010 05:16:44 +0000 (14:16 +0900)
        PR fortran/43178
        * trans-array.c (gfc_conv_expr_descriptor): Update
        gfc_trans_scalar_assign call.
        (has_default_initializer): New function.
        (gfc_trans_deferred_array): Nullify less often.
        * trans-expr.c (gfc_conv_subref_array_arg,
        gfc_trans_subcomponent_assign): Update call to
        gfc_trans_scalar_assign.
        (gfc_trans_scalar_assign): Add parameter and pass it on.
        (gfc_trans_assignment_1): Optionally, do not dealloc before
        assignment.
        * trans-openmp.c (gfc_trans_omp_array_reduction): Update
        call to gfc_trans_scalar_assign.
        * trans-decl.c (gfc_get_symbol_decl): Do not always apply
        initializer to static variables.
        (gfc_init_default_dt): Add dealloc parameter and pass it on.
        * trans-stmt.c (forall_make_variable_temp,
        generate_loop_for_temp_to_lhs, generate_loop_for_rhs_to_temp,
        gfc_trans_forall_1, gfc_trans_where_assign, gfc_trans_where_3
        gfc_trans_allocate): Update gfc_trans_assignment call.
        * trans.h (gfc_trans_scalar_assign, gfc_init_default_dt,
        gfc_init_default_dt, gfc_trans_assignment): Add bool dealloc
        parameter to prototype.

2010-04-06  Tobias Burnus  <burnus@net-b.de>

        PR fortran/43178
        * gfortran.dg/alloc_comp_basics_1.f90: Update
        * scan-tree-dump-times.
        * gfortran.dg/alloc_comp_constructor_1.f90: Ditto.
        * gfortran.dg/auto_dealloc_1.f90: Ditto.

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

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

index 53884cc..97a2fca 100644 (file)
@@ -1,3 +1,29 @@
+2010-04-06  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/43178
+       * trans-array.c (gfc_conv_expr_descriptor): Update
+       gfc_trans_scalar_assign call.
+       (has_default_initializer): New function.
+       (gfc_trans_deferred_array): Nullify less often.
+       * trans-expr.c (gfc_conv_subref_array_arg,
+       gfc_trans_subcomponent_assign): Update call to
+       gfc_trans_scalar_assign.
+       (gfc_trans_scalar_assign): Add parameter and pass it on.
+       (gfc_trans_assignment_1): Optionally, do not dealloc before
+       assignment.
+       * trans-openmp.c (gfc_trans_omp_array_reduction): Update
+       call to gfc_trans_scalar_assign.
+       * trans-decl.c (gfc_get_symbol_decl): Do not always apply
+       initializer to static variables.
+       (gfc_init_default_dt): Add dealloc parameter and pass it on.
+       * trans-stmt.c (forall_make_variable_temp,
+       generate_loop_for_temp_to_lhs, generate_loop_for_rhs_to_temp,
+       gfc_trans_forall_1, gfc_trans_where_assign, gfc_trans_where_3
+       gfc_trans_allocate): Update gfc_trans_assignment call.
+       * trans.h (gfc_trans_scalar_assign, gfc_init_default_dt,
+       gfc_init_default_dt, gfc_trans_assignment): Add bool dealloc
+       parameter to prototype.
+
 2010-03-31  Paul Thomas  <pault@gcc.gnu.org>
 
        * ioparm.def : Update copyright.
index 127e322..5f53768 100644 (file)
@@ -5454,103 +5454,6 @@ gfc_trans_assign (gfc_code * code)
 }
 
 
-/* Generate code to assign typebound procedures to a derived vtab.  */
-void gfc_trans_assign_vtab_procs (stmtblock_t *block, gfc_symbol *dt,
-                                 gfc_symbol *vtab)
-{
-  gfc_component *cmp;
-  tree vtb;
-  tree ctree;
-  tree proc;
-  tree cond = NULL_TREE;
-  stmtblock_t body;
-  bool seen_extends;
-
-  /* Point to the first procedure pointer.  */
-  cmp = gfc_find_component (vtab->ts.u.derived, "$extends", true, true);
-
-  seen_extends = (cmp != NULL);
-
-  vtb = gfc_get_symbol_decl (vtab);
-
-  if (seen_extends)
-    {
-      cmp = cmp->next;
-      if (!cmp)
-       return;
-      ctree = fold_build3 (COMPONENT_REF, TREE_TYPE (cmp->backend_decl),
-                          vtb, cmp->backend_decl, NULL_TREE);
-      cond = fold_build2 (EQ_EXPR, boolean_type_node, ctree,
-                          build_int_cst (TREE_TYPE (ctree), 0));
-    }
-  else
-    {
-      cmp = vtab->ts.u.derived->components; 
-    }
-
-  gfc_init_block (&body);
-  for (; cmp; cmp = cmp->next)
-    {
-      gfc_symbol *target = NULL;
-      
-      /* Generic procedure - build its vtab.  */
-      if (cmp->ts.type == BT_DERIVED && !cmp->tb)
-       {
-         gfc_symbol *vt = cmp->ts.interface;
-
-         if (vt == NULL)
-           {
-             /* Use association loses the interface.  Obtain the vtab
-                by name instead.  */
-             char name[2 * GFC_MAX_SYMBOL_LEN + 8];
-             sprintf (name, "vtab$%s$%s", vtab->ts.u.derived->name,
-                      cmp->name);
-             gfc_find_symbol (name, vtab->ns, 0, &vt);
-             if (vt == NULL)
-               continue;
-           }
-
-         gfc_trans_assign_vtab_procs (&body, dt, vt);
-         ctree = fold_build3 (COMPONENT_REF, TREE_TYPE (cmp->backend_decl),
-                              vtb, cmp->backend_decl, NULL_TREE);
-         proc = gfc_get_symbol_decl (vt);
-         proc = gfc_build_addr_expr (TREE_TYPE (ctree), proc);
-         gfc_add_modify (&body, ctree, proc);
-         continue;
-       }
-
-      /* This is required when typebound generic procedures are called
-        with derived type targets.  The specific procedures do not get
-        added to the vtype, which remains "empty".  */
-      if (cmp->tb && cmp->tb->u.specific && cmp->tb->u.specific->n.sym)
-       target = cmp->tb->u.specific->n.sym;
-      else
-       {
-         gfc_symtree *st;
-         st = gfc_find_typebound_proc (dt, NULL, cmp->name, false, NULL);
-         if (st->n.tb && st->n.tb->u.specific)
-           target = st->n.tb->u.specific->n.sym;
-       }
-
-      if (!target)
-       continue;
-
-      ctree = fold_build3 (COMPONENT_REF, TREE_TYPE (cmp->backend_decl),
-                          vtb, cmp->backend_decl, NULL_TREE);
-      proc = gfc_get_symbol_decl (target);
-      proc = gfc_build_addr_expr (TREE_TYPE (ctree), proc);
-      gfc_add_modify (&body, ctree, proc);
-    }
-
-  proc = gfc_finish_block (&body);
-
-  if (seen_extends)
-    proc = build3_v (COND_EXPR, cond, proc, build_empty_stmt (input_location));
-
-  gfc_add_expr_to_block (block, proc);
-}
-
-
 /* Translate an assignment to a CLASS object
    (pointer or ordinary assignment).  */
 
index eb15225..7330c96 100644 (file)
@@ -1,3 +1,10 @@
+2010-04-06  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/43178
+       * gfortran.dg/alloc_comp_basics_1.f90: Update scan-tree-dump-times.
+       * gfortran.dg/alloc_comp_constructor_1.f90: Ditto.
+       * gfortran.dg/auto_dealloc_1.f90: Ditto.
+
 2010-04-06  Richard Guenther  <rguenther@suse.de>
 
        PR tree-optimization/43627