Commit 7a412892 by Mikael Morin

trans.h (struct gfc_ss, [...]): Move field gfc_ss::useflags into gfc_ss_info.

	* 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.

From-SVN: r180875
parent c3b0bfe1
2011-11-03 Mikael Morin <mikael@gcc.gnu.org> 2011-11-03 Mikael Morin <mikael@gcc.gnu.org>
* trans.h (struct gfc_ss, struct gfc_ss_info): Move field * 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::info into gfc_ss_info::data and remove empty union
gfc_ss::data. gfc_ss::data.
* trans-array.c (gfc_free_ss, gfc_trans_create_temp_array, * trans-array.c (gfc_free_ss, gfc_trans_create_temp_array,
......
...@@ -463,7 +463,7 @@ void ...@@ -463,7 +463,7 @@ void
gfc_mark_ss_chain_used (gfc_ss * ss, unsigned flags) gfc_mark_ss_chain_used (gfc_ss * ss, unsigned flags)
{ {
for (; ss != gfc_ss_terminator; ss = ss->next) for (; ss != gfc_ss_terminator; ss = ss->next)
ss->useflags = flags; ss->info->useflags = flags;
} }
static void gfc_free_ss (gfc_ss *); static void gfc_free_ss (gfc_ss *);
...@@ -2906,7 +2906,7 @@ gfc_trans_preloop_setup (gfc_loopinfo * loop, int dim, int flag, ...@@ -2906,7 +2906,7 @@ gfc_trans_preloop_setup (gfc_loopinfo * loop, int dim, int flag,
{ {
ss_info = ss->info; ss_info = ss->info;
if ((ss->useflags & flag) == 0) if ((ss_info->useflags & flag) == 0)
continue; continue;
ss_type = ss_info->type; ss_type = ss_info->type;
...@@ -3148,7 +3148,7 @@ gfc_trans_scalarizing_loops (gfc_loopinfo * loop, stmtblock_t * body) ...@@ -3148,7 +3148,7 @@ gfc_trans_scalarizing_loops (gfc_loopinfo * loop, stmtblock_t * body)
/* Clear all the used flags. */ /* Clear all the used flags. */
for (ss = loop->ss; ss != gfc_ss_terminator; ss = ss->loop_chain) 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) ...@@ -3185,7 +3185,7 @@ gfc_trans_scalarized_loop_boundary (gfc_loopinfo * loop, stmtblock_t * body)
ss_info = ss->info; ss_info = ss->info;
if ((ss->useflags & 2) == 0) if ((ss_info->useflags & 2) == 0)
continue; continue;
ss_type = ss_info->type; ss_type = ss_info->type;
......
...@@ -2898,7 +2898,7 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym, ...@@ -2898,7 +2898,7 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym,
if (!sym->attr.elemental) if (!sym->attr.elemental)
{ {
gcc_assert (se->ss->info->type == GFC_SS_FUNCTION); 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) gcc_assert ((!comp && gfc_return_by_reference (sym)
&& sym->result->attr.dimension) && sym->result->attr.dimension)
...@@ -2983,7 +2983,7 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym, ...@@ -2983,7 +2983,7 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym,
gfc_init_se (&parmse, se); gfc_init_se (&parmse, se);
gfc_conv_derived_to_class (&parmse, e, fsym->ts); 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. */ /* An elemental function inside a scalarized loop. */
gfc_init_se (&parmse, se); gfc_init_se (&parmse, se);
......
...@@ -6634,7 +6634,7 @@ gfc_conv_intrinsic_function (gfc_se * se, gfc_expr * expr) ...@@ -6634,7 +6634,7 @@ gfc_conv_intrinsic_function (gfc_se * se, gfc_expr * expr)
break; break;
case GFC_ISYM_TRANSFER: case GFC_ISYM_TRANSFER:
if (se->ss && se->ss->useflags) if (se->ss && se->ss->info->useflags)
/* Access the previously obtained result. */ /* Access the previously obtained result. */
gfc_conv_tmp_array_ref (se); gfc_conv_tmp_array_ref (se);
else else
......
...@@ -209,6 +209,11 @@ typedef struct gfc_ss_info ...@@ -209,6 +209,11 @@ typedef struct gfc_ss_info
gfc_array_info array; gfc_array_info array;
} }
data; 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; gfc_ss_info;
...@@ -237,11 +242,9 @@ typedef struct gfc_ss ...@@ -237,11 +242,9 @@ typedef struct gfc_ss
struct gfc_ss *loop_chain; struct gfc_ss *loop_chain;
struct gfc_ss *next; struct gfc_ss *next;
/* This is used by assignments requiring temporaries. The bits specify which /* The bit 'where' suppresses precalculation of scalars in WHERE assignments.
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 unsigned where:1, is_alloc_lhs:1;
'where' suppresses precalculation of scalars in WHERE assignments. */
unsigned useflags:2, where:1, is_alloc_lhs:1;
} }
gfc_ss; gfc_ss;
#define gfc_get_ss() XCNEW (gfc_ss) #define gfc_get_ss() XCNEW (gfc_ss)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment