trans.h (struct gfc_ss, [...]): Move member struct gfc_ss::data::scalar into newly created union...

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

From-SVN: r180870
This commit is contained in:
Mikael Morin 2011-11-03 22:10:25 +00:00
parent a0add3be3e
commit 99dd5a2990
5 changed files with 27 additions and 13 deletions

View File

@ -1,3 +1,13 @@
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

View 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
{

View 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;

View 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;

View 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
{