OSDN Git Service

* trans.h (gfc_inline_intrinsic_function_p): Move prototype...
[pf3gnuchains/gcc-fork.git] / gcc / fortran / trans.h
index 60708e9..5757865 100644 (file)
@@ -185,6 +185,7 @@ gfc_ss_type;
 
 typedef struct gfc_ss_info
 {
+  int refcount;
   gfc_ss_type type;
   gfc_expr *expr;
   tree string_length;
@@ -204,8 +205,19 @@ typedef struct gfc_ss_info
       tree type;
     }
     temp;
+
+    /* All other types.  */
+    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;
+
+  /* Suppresses precalculation of scalars in WHERE assignments.  */
+  unsigned where:1;
 }
 gfc_ss_info;
 
@@ -224,13 +236,6 @@ typedef struct gfc_ss
 {
   gfc_ss_info *info;
 
-  union
-  {
-    /* All other types.  */
-    gfc_array_info info;
-  }
-  data;
-
   int dimen;
   /* Translation from loop dimensions to actual array dimensions.
      actual_dim = dim[loop_dim]  */
@@ -241,11 +246,18 @@ 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;
+  /* Non-null if the ss is part of a nested loop.  */
+  struct gfc_ss *parent;
+
+  /* If the evaluation of an expression requires a nested loop (for example
+     if the sum intrinsic is evaluated inline), this points to the nested
+     loop's gfc_ss.  */
+  struct gfc_ss *nested_ss;
+
+  /* The loop this gfc_ss is in.  */
+  struct gfc_loopinfo *loop;
+
+  unsigned is_alloc_lhs:1;
 }
 gfc_ss;
 #define gfc_get_ss() XCNEW (gfc_ss)
@@ -267,6 +279,12 @@ typedef struct gfc_loopinfo
   /* The SS describing the temporary used in an assignment.  */
   gfc_ss *temp_ss;
 
+  /* Non-null if this loop is nested in another one.  */
+  struct gfc_loopinfo *parent;
+
+  /* Chain of nested loops.  */
+  struct gfc_loopinfo *nested, *next;
+
   /* The scalarization loop index variables.  */
   tree loopvar[GFC_MAX_DIMENSIONS];
 
@@ -378,9 +396,6 @@ tree gfc_builtin_decl_for_float_kind (enum built_in_function, int);
 tree gfc_conv_intrinsic_subroutine (gfc_code *);
 void gfc_conv_intrinsic_function (gfc_se *, gfc_expr *);
 
-/* Is the intrinsic expanded inline.  */
-bool gfc_inline_intrinsic_function_p (gfc_expr *);
-
 /* Does an intrinsic map directly to an external library call
    This is true for array-returning intrinsics, unless
    gfc_inline_intrinsic_function_p returns true.  */