summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormikael <mikael@138bc75d-0d04-0410-961f-82ee72b054a4>2011-11-03 22:29:25 +0000
committermikael <mikael@138bc75d-0d04-0410-961f-82ee72b054a4>2011-11-03 22:29:25 +0000
commit77e80024c9a3ed5a229e1cb4a5afe6b639eebf47 (patch)
treeb924b38f05bcb9fee71a912b4c69eb58b408cd0a
parent1b3fff24b46c1fbc5686b62512a1bc496524cf15 (diff)
downloadgcc-77e80024c9a3ed5a229e1cb4a5afe6b639eebf47.tar.gz
* trans.h (struct gfc_ss, struct gfc_ss_info): Move field
gfc_ss::where into gfc_ss_info. * trans-array.c (gfc_add_loop_ss_code): Update reference chains. * trans-stmt.c (gfc_trans_where_assign, gfc_trans_where_3): Ditto. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@180877 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/fortran/ChangeLog8
-rw-r--r--gcc/fortran/trans-array.c2
-rw-r--r--gcc/fortran/trans-stmt.c6
-rw-r--r--gcc/fortran/trans.h7
4 files changed, 16 insertions, 7 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index baa20a9de82..802c2ff4ba8 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,6 +1,14 @@
2011-11-03 Mikael Morin <mikael@gcc.gnu.org>
* trans.h (struct gfc_ss, struct gfc_ss_info): Move field
+ gfc_ss::where into gfc_ss_info.
+ * trans-array.c (gfc_add_loop_ss_code):
+ Update reference chains.
+ * trans-stmt.c (gfc_trans_where_assign, gfc_trans_where_3): Ditto.
+
+2011-11-03 Mikael Morin <mikael@gcc.gnu.org>
+
+ * 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):
diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c
index 427bb7b53d1..045c426cab1 100644
--- a/gcc/fortran/trans-array.c
+++ b/gcc/fortran/trans-array.c
@@ -2203,7 +2203,7 @@ gfc_add_loop_ss_code (gfc_loopinfo * loop, gfc_ss * ss, bool subscript,
scalarization loop, except for WHERE assignments. */
if (subscript)
se.expr = convert(gfc_array_index_type, se.expr);
- if (!ss->where)
+ if (!ss_info->where)
se.expr = gfc_evaluate_now (se.expr, &loop->pre);
gfc_add_block_to_block (&loop->pre, &se.post);
}
diff --git a/gcc/fortran/trans-stmt.c b/gcc/fortran/trans-stmt.c
index 101a6513ed9..86a56e8c19a 100644
--- a/gcc/fortran/trans-stmt.c
+++ b/gcc/fortran/trans-stmt.c
@@ -4062,7 +4062,7 @@ gfc_trans_where_assign (gfc_expr *expr1, gfc_expr *expr2,
{
/* The rhs is scalar. Add a ss for the expression. */
rss = gfc_get_scalar_ss (gfc_ss_terminator, expr2);
- rss->where = 1;
+ rss->info->where = 1;
}
/* Associate the SS with the loop. */
@@ -4501,7 +4501,7 @@ gfc_trans_where_3 (gfc_code * cblock, gfc_code * eblock)
if (tsss == gfc_ss_terminator)
{
tsss = gfc_get_scalar_ss (gfc_ss_terminator, tsrc);
- tsss->where = 1;
+ tsss->info->where = 1;
}
gfc_add_ss_to_loop (&loop, tdss);
gfc_add_ss_to_loop (&loop, tsss);
@@ -4516,7 +4516,7 @@ gfc_trans_where_3 (gfc_code * cblock, gfc_code * eblock)
if (esss == gfc_ss_terminator)
{
esss = gfc_get_scalar_ss (gfc_ss_terminator, esrc);
- esss->where = 1;
+ esss->info->where = 1;
}
gfc_add_ss_to_loop (&loop, edss);
gfc_add_ss_to_loop (&loop, esss);
diff --git a/gcc/fortran/trans.h b/gcc/fortran/trans.h
index 907c2713958..c35b1ae0fda 100644
--- a/gcc/fortran/trans.h
+++ b/gcc/fortran/trans.h
@@ -214,6 +214,9 @@ typedef struct gfc_ss_info
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;
@@ -242,9 +245,7 @@ typedef struct gfc_ss
struct gfc_ss *loop_chain;
struct gfc_ss *next;
- /* The bit 'where' suppresses precalculation of scalars in WHERE assignments.
- */
- unsigned where:1, is_alloc_lhs:1;
+ unsigned is_alloc_lhs:1;
}
gfc_ss;
#define gfc_get_ss() XCNEW (gfc_ss)