OSDN Git Service

* trans.h (struct gfc_ss, struct gfc_ss_info): Move member struct
authormikael <mikael@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 3 Nov 2011 22:10:25 +0000 (22:10 +0000)
committermikael <mikael@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 3 Nov 2011 22:10:25 +0000 (22:10 +0000)
gfc_ss::data::scalar into newly created union gfc_ss_info::data,
and rename subfield expr to value.
* trans-array.c (gfc_add_loop_ss_code, gfc_conv_array_index_offset,
gfc_conv_expr_descriptor): Update reference chains.
* trans-const.c (gfc_conv_constant): Ditto.
* trans-expr.c (gfc_conv_expr): Ditto.

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

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

index 3f1339f..f10419a 100644 (file)
@@ -1,5 +1,15 @@
 2011-11-03  Mikael Morin  <mikael@gcc.gnu.org>
 
+       * trans.h (struct gfc_ss, struct gfc_ss_info): Move member struct
+       gfc_ss::data::scalar into newly created union gfc_ss_info::data,
+       and rename subfield expr to value.
+       * trans-array.c (gfc_add_loop_ss_code, gfc_conv_array_index_offset,
+       gfc_conv_expr_descriptor): Update reference chains.
+       * trans-const.c (gfc_conv_constant): Ditto.
+       * trans-expr.c (gfc_conv_expr): Ditto.
+
+2011-11-03  Mikael Morin  <mikael@gcc.gnu.org>
+
        * trans.h (struct gfc_ss, struct gfc_ss_info): Move field
        string_length from the former struct to the latter.
        * trans-array.c
index 827d13d..eef0f09 100644 (file)
@@ -2208,7 +2208,7 @@ gfc_add_loop_ss_code (gfc_loopinfo * loop, gfc_ss * ss, bool subscript,
          else
            gfc_add_block_to_block (&loop->post, &se.post);
 
-         ss->data.scalar.expr = se.expr;
+         ss_info->data.scalar.value = se.expr;
          ss_info->string_length = se.string_length;
          break;
 
@@ -2220,7 +2220,7 @@ gfc_add_loop_ss_code (gfc_loopinfo * loop, gfc_ss * ss, bool subscript,
          gfc_add_block_to_block (&loop->pre, &se.pre);
          gfc_add_block_to_block (&loop->post, &se.post);
 
-         ss->data.scalar.expr = gfc_evaluate_now (se.expr, &loop->pre);
+         ss_info->data.scalar.value = gfc_evaluate_now (se.expr, &loop->pre);
          ss_info->string_length = se.string_length;
          break;
 
@@ -2571,7 +2571,7 @@ conv_array_index_offset (gfc_se * se, gfc_ss * ss, int dim, int i,
          gcc_assert (info->subscript[dim]
                      && info->subscript[dim]->info->type == GFC_SS_SCALAR);
          /* We've already translated this value outside the loop.  */
-         index = info->subscript[dim]->data.scalar.expr;
+         index = info->subscript[dim]->info->data.scalar.value;
 
          index = trans_array_bound_check (se, ss, index, dim, &ar->where,
                                           ar->as->type != AS_ASSUMED_SIZE
@@ -6134,7 +6134,7 @@ gfc_conv_expr_descriptor (gfc_se * se, gfc_expr * expr, gfc_ss * ss)
            {
              gcc_assert (info->subscript[n]
                          && info->subscript[n]->info->type == GFC_SS_SCALAR);
-             start = info->subscript[n]->data.scalar.expr;
+             start = info->subscript[n]->info->data.scalar.value;
            }
          else
            {
index 35a5e68..fa820ef 100644 (file)
@@ -392,7 +392,7 @@ gfc_conv_constant (gfc_se * se, gfc_expr * expr)
       gcc_assert (ss_info->type == GFC_SS_SCALAR);
       gcc_assert (ss_info->expr == expr);
 
-      se->expr = se->ss->data.scalar.expr;
+      se->expr = ss_info->data.scalar.value;
       se->string_length = ss_info->string_length;
       gfc_advance_se_ss_chain (se);
       return;
index 87734f1..55853f1 100644 (file)
@@ -4840,7 +4840,7 @@ gfc_conv_expr (gfc_se * se, gfc_expr * expr)
       ss_info = ss->info;
       /* Substitute a scalar expression evaluated outside the scalarization
          loop.  */
-      se->expr = se->ss->data.scalar.expr;
+      se->expr = ss_info->data.scalar.value;
       if (ss_info->type == GFC_SS_REFERENCE)
        se->expr = gfc_build_addr_expr (NULL_TREE, se->expr);
       se->string_length = ss_info->string_length;
index f1b109a..567e5a3 100644 (file)
@@ -188,6 +188,17 @@ typedef struct gfc_ss_info
   gfc_ss_type type;
   gfc_expr *expr;
   tree string_length;
+
+  union
+  {
+    /* If type is GFC_SS_SCALAR or GFC_SS_REFERENCE.  */
+    struct
+    {
+      tree value;
+    }
+    scalar;
+  }
+  data;
 }
 gfc_ss_info;
 
@@ -208,13 +219,6 @@ typedef struct gfc_ss
 
   union
   {
-    /* If type is GFC_SS_SCALAR or GFC_SS_REFERENCE.  */
-    struct
-    {
-      tree expr;
-    }
-    scalar;
-
     /* GFC_SS_TEMP.  */
     struct
     {