From: Mikael Morin Date: Thu, 3 Nov 2011 22:29:25 +0000 (+0000) Subject: trans.h (struct gfc_ss, [...]): Move field gfc_ss::where into gfc_ss_info. X-Git-Tag: releases/gcc-4.7.0~2559 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=42d0058e4972b3c6bf67ef2dfc9ca0d0d5451839;p=thirdparty%2Fgcc.git trans.h (struct gfc_ss, [...]): Move field gfc_ss::where into gfc_ss_info. * 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. From-SVN: r180877 --- diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index baa20a9de82f..802c2ff4ba83 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,11 @@ +2011-11-03 Mikael Morin + + * 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 * trans.h (struct gfc_ss, struct gfc_ss_info): Move field diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c index 427bb7b53d1a..045c426cab10 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 101a6513ed9e..86a56e8c19a4 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 907c2713958d..c35b1ae0fdac 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)