OSDN Git Service

* trans.h (struct gfc_ss, struct gfc_ss_info): Move member struct
[pf3gnuchains/gcc-fork.git] / gcc / fortran / trans-expr.c
index 5a94615..55853f1 100644 (file)
@@ -613,6 +613,7 @@ conv_parent_component_references (gfc_se * se, gfc_ref * ref)
 static void
 gfc_conv_variable (gfc_se * se, gfc_expr * expr)
 {
+  gfc_ss *ss;
   gfc_ref *ref;
   gfc_symbol *sym;
   tree parent_decl = NULL_TREE;
@@ -622,15 +623,18 @@ gfc_conv_variable (gfc_se * se, gfc_expr * expr)
   bool entry_master;
 
   sym = expr->symtree->n.sym;
-  if (se->ss != NULL)
+  ss = se->ss;
+  if (ss != NULL)
     {
+      gfc_ss_info *ss_info = ss->info;
+
       /* Check that something hasn't gone horribly wrong.  */
-      gcc_assert (se->ss != gfc_ss_terminator);
-      gcc_assert (se->ss->expr == expr);
+      gcc_assert (ss != gfc_ss_terminator);
+      gcc_assert (ss_info->expr == expr);
 
       /* A scalarized term.  We already know the descriptor.  */
       se->expr = se->ss->data.info.descriptor;
-      se->string_length = se->ss->string_length;
+      se->string_length = ss_info->string_length;
       for (ref = se->ss->data.info.ref; ref; ref = ref->next)
        if (ref->type == REF_ARRAY && ref->u.ar.type != AR_ELEMENT)
          break;
@@ -2400,7 +2404,7 @@ gfc_conv_subref_array_arg (gfc_se * parmse, gfc_expr * expr, int g77,
                                              : NULL),
                                  loop.dimen);
 
-  parmse->string_length = loop.temp_ss->string_length;
+  parmse->string_length = loop.temp_ss->info->string_length;
 
   /* Associate the SS with the loop.  */
   gfc_add_ss_to_loop (&loop, loop.temp_ss);
@@ -3604,8 +3608,8 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym,
          callee_alloc = comp->attr.allocatable || comp->attr.pointer;
          gfc_trans_create_temp_array (&se->pre, &se->post, se->loop, se->ss,
                                       tmp, NULL_TREE, false,
-                                      !comp->attr.pointer,
-                                      callee_alloc, &se->ss->expr->where);
+                                      !comp->attr.pointer, callee_alloc,
+                                      &se->ss->info->expr->where);
 
          /* Pass the temporary as the first argument.  */
          result = info->descriptor;
@@ -3640,8 +3644,8 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym,
          callee_alloc = sym->attr.allocatable || sym->attr.pointer;
          gfc_trans_create_temp_array (&se->pre, &se->post, se->loop, se->ss,
                                       tmp, NULL_TREE, false,
-                                      !sym->attr.pointer,
-                                      callee_alloc, &se->ss->expr->where);
+                                      !sym->attr.pointer, callee_alloc,
+                                      &se->ss->info->expr->where);
 
          /* Pass the temporary as the first argument.  */
          result = info->descriptor;
@@ -4243,7 +4247,7 @@ gfc_conv_array_constructor_expr (gfc_se * se, gfc_expr * expr)
 
   ss = se->ss;
   gcc_assert (ss != NULL && ss != gfc_ss_terminator);
-  gcc_assert (ss->expr == expr && ss->info->type == GFC_SS_CONSTRUCTOR);
+  gcc_assert (ss->info->expr == expr && ss->info->type == GFC_SS_CONSTRUCTOR);
 
   gfc_conv_tmp_array_ref (se);
 }
@@ -4827,16 +4831,19 @@ gfc_conv_expr (gfc_se * se, gfc_expr * expr)
   gfc_ss *ss;
 
   ss = se->ss;
-  if (ss && ss->expr == expr
+  if (ss && ss->info->expr == expr
       && (ss->info->type == GFC_SS_SCALAR
          || ss->info->type == GFC_SS_REFERENCE))
     {
+      gfc_ss_info *ss_info;
+
+      ss_info = ss->info;
       /* Substitute a scalar expression evaluated outside the scalarization
          loop.  */
-      se->expr = se->ss->data.scalar.expr;
-      if (ss->info->type == GFC_SS_REFERENCE)
+      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 = se->ss->string_length;
+      se->string_length = ss_info->string_length;
       gfc_advance_se_ss_chain (se);
       return;
     }
@@ -4957,7 +4964,7 @@ gfc_conv_expr_reference (gfc_se * se, gfc_expr * expr)
   tree var;
 
   ss = se->ss;
-  if (ss && ss->expr == expr
+  if (ss && ss->info->expr == expr
       && ss->info->type == GFC_SS_REFERENCE)
     {
       /* Returns a reference to the scalar evaluated outside the loop