OSDN Git Service

* trans.h (struct gfc_ss, struct gfc_ss_info): Move field
authormikael <mikael@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 3 Nov 2011 22:24:37 +0000 (22:24 +0000)
committermikael <mikael@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 3 Nov 2011 22:24:37 +0000 (22:24 +0000)
gfc_ss::useflags into gfc_ss_info.
* trans-array.c (gfc_mark_ss_chain_used, gfc_trans_preloop_setup,
gfc_trans_scalarizing_loops, gfc_trans_scalarized_boundary):
Update reference chains.
* trans-expr.c (gfc_conv_procedure_call): Ditto.
* trans-intrinsic.c (gfc_conv_intrinsic_function): Ditto.

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

gcc/fortran/ChangeLog
gcc/fortran/trans-array.c
gcc/fortran/trans-expr.c
gcc/fortran/trans-intrinsic.c
gcc/fortran/trans.h

index 2767e32..baa20a9 100644 (file)
@@ -1,6 +1,16 @@
 2011-11-03  Mikael Morin  <mikael@gcc.gnu.org>
 
        * trans.h (struct gfc_ss, struct gfc_ss_info): Move field
+       gfc_ss::useflags into gfc_ss_info.
+       * trans-array.c (gfc_mark_ss_chain_used, gfc_trans_preloop_setup,
+       gfc_trans_scalarizing_loops, gfc_trans_scalarized_boundary):
+       Update reference chains.
+       * trans-expr.c (gfc_conv_procedure_call): Ditto.
+       * trans-intrinsic.c (gfc_conv_intrinsic_function): Ditto.
+
+2011-11-03  Mikael Morin  <mikael@gcc.gnu.org>
+
+       * trans.h (struct gfc_ss, struct gfc_ss_info): Move field
        gfc_ss::data::info into gfc_ss_info::data and remove empty union
        gfc_ss::data.
        * trans-array.c (gfc_free_ss, gfc_trans_create_temp_array,
index 78e1443..427bb7b 100644 (file)
@@ -463,7 +463,7 @@ void
 gfc_mark_ss_chain_used (gfc_ss * ss, unsigned flags)
 {
   for (; ss != gfc_ss_terminator; ss = ss->next)
-    ss->useflags = flags;
+    ss->info->useflags = flags;
 }
 
 static void gfc_free_ss (gfc_ss *);
@@ -2906,7 +2906,7 @@ gfc_trans_preloop_setup (gfc_loopinfo * loop, int dim, int flag,
     {
       ss_info = ss->info;
 
-      if ((ss->useflags & flag) == 0)
+      if ((ss_info->useflags & flag) == 0)
        continue;
 
       ss_type = ss_info->type;
@@ -3148,7 +3148,7 @@ gfc_trans_scalarizing_loops (gfc_loopinfo * loop, stmtblock_t * body)
 
   /* Clear all the used flags.  */
   for (ss = loop->ss; ss != gfc_ss_terminator; ss = ss->loop_chain)
-    ss->useflags = 0;
+    ss->info->useflags = 0;
 }
 
 
@@ -3185,7 +3185,7 @@ gfc_trans_scalarized_loop_boundary (gfc_loopinfo * loop, stmtblock_t * body)
 
       ss_info = ss->info;
 
-      if ((ss->useflags & 2) == 0)
+      if ((ss_info->useflags & 2) == 0)
        continue;
 
       ss_type = ss_info->type;
index b175b62..01d4ca3 100644 (file)
@@ -2898,7 +2898,7 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym,
       if (!sym->attr.elemental)
        {
          gcc_assert (se->ss->info->type == GFC_SS_FUNCTION);
-         if (se->ss->useflags)
+         if (se->ss->info->useflags)
            {
              gcc_assert ((!comp && gfc_return_by_reference (sym)
                           && sym->result->attr.dimension)
@@ -2983,7 +2983,7 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym,
          gfc_init_se (&parmse, se);
          gfc_conv_derived_to_class (&parmse, e, fsym->ts);
        }
-      else if (se->ss && se->ss->useflags)
+      else if (se->ss && se->ss->info->useflags)
        {
          /* An elemental function inside a scalarized loop.  */
          gfc_init_se (&parmse, se);
index a3b7383..fcc59d7 100644 (file)
@@ -6634,7 +6634,7 @@ gfc_conv_intrinsic_function (gfc_se * se, gfc_expr * expr)
       break;
 
     case GFC_ISYM_TRANSFER:
-      if (se->ss && se->ss->useflags)
+      if (se->ss && se->ss->info->useflags)
        /* Access the previously obtained result.  */
        gfc_conv_tmp_array_ref (se);
       else
index e74da41..907c271 100644 (file)
@@ -209,6 +209,11 @@ typedef struct gfc_ss_info
     gfc_array_info array;
   }
   data;
+
+  /* This is used by assignments requiring temporaries.  The bits specify which
+     loops the terms appear in.  This will be 1 for the RHS expressions,
+     2 for the LHS expressions, and 3(=1|2) for the temporary.  */
+  unsigned useflags:2;
 }
 gfc_ss_info;
 
@@ -237,11 +242,9 @@ typedef struct gfc_ss
   struct gfc_ss *loop_chain;
   struct gfc_ss *next;
 
-  /* This is used by assignments requiring temporaries. The bits specify which
-     loops the terms appear in.  This will be 1 for the RHS expressions,
-     2 for the LHS expressions, and 3(=1|2) for the temporary.  The bit
-     'where' suppresses precalculation of scalars in WHERE assignments.  */
-  unsigned useflags:2, where:1, is_alloc_lhs:1;
+  /* The bit 'where' suppresses precalculation of scalars in WHERE assignments.
+  */
+  unsigned where:1, is_alloc_lhs:1;
 }
 gfc_ss;
 #define gfc_get_ss() XCNEW (gfc_ss)