diff options
author | mikael <mikael@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-11-03 22:10:25 +0000 |
---|---|---|
committer | mikael <mikael@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-11-03 22:10:25 +0000 |
commit | aaaf75f7383104e9da85f377bf647e21f79049dd (patch) | |
tree | d8a32fbcba1fbace247eca6d8b5f47cd2780b1a0 /gcc/fortran | |
parent | 3d653dea0f9e13fd2484d3ee3135800c2c93a0eb (diff) | |
download | gcc-aaaf75f7383104e9da85f377bf647e21f79049dd.tar.gz |
* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@180870 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran')
-rw-r--r-- | gcc/fortran/ChangeLog | 10 | ||||
-rw-r--r-- | gcc/fortran/trans-array.c | 8 | ||||
-rw-r--r-- | gcc/fortran/trans-const.c | 2 | ||||
-rw-r--r-- | gcc/fortran/trans-expr.c | 2 | ||||
-rw-r--r-- | gcc/fortran/trans.h | 18 |
5 files changed, 27 insertions, 13 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 3f1339f36e2..f10419a6b62 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -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 diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c index 827d13d3946..eef0f097f2a 100644 --- a/gcc/fortran/trans-array.c +++ b/gcc/fortran/trans-array.c @@ -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 { diff --git a/gcc/fortran/trans-const.c b/gcc/fortran/trans-const.c index 35a5e687d53..fa820ef10de 100644 --- a/gcc/fortran/trans-const.c +++ b/gcc/fortran/trans-const.c @@ -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; diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c index 87734f17984..55853f19d2b 100644 --- a/gcc/fortran/trans-expr.c +++ b/gcc/fortran/trans-expr.c @@ -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; diff --git a/gcc/fortran/trans.h b/gcc/fortran/trans.h index f1b109a80e8..567e5a343f1 100644 --- a/gcc/fortran/trans.h +++ b/gcc/fortran/trans.h @@ -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 { |