aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/trans-stmt.c
diff options
context:
space:
mode:
authorMikael Morin <mikael.morin@sfr.fr>2011-09-08 17:30:39 +0200
committerMikael Morin <mikael@gcc.gnu.org>2011-09-08 15:30:39 +0000
commit26f7753013e52c93c6d63bb678b1544da43a2384 (patch)
treebf1d67ae319908ea0112fe103dc2c1d5de388cdc /gcc/fortran/trans-stmt.c
parenta1ae4f435fc547fcae4bf04b6c4efcc310328b3e (diff)
downloadgcc-26f7753013e52c93c6d63bb678b1544da43a2384.zip
gcc-26f7753013e52c93c6d63bb678b1544da43a2384.tar.gz
gcc-26f7753013e52c93c6d63bb678b1544da43a2384.tar.bz2
trans-array.h (gfc_get_scalar_ss): New prototype.
2011-09-08 Mikael Morin <mikael.morin@sfr.fr> * trans-array.h (gfc_get_scalar_ss): New prototype. * trans-array.c (gfc_get_scalar_ss): New function. (gfc_walk_variable_expr, gfc_walk_op_expr, gfc_walk_elemental_function_args): Re-use gfc_get_scalar_ss. * trans-expr.c (gfc_trans_subarray_assign): Ditto. (gfc_trans_assignment_1): Ditto. * trans-stmt.c (compute_inner_temp_size, gfc_trans_where_assign, gfc_trans_where_3): Ditto. From-SVN: r178697
Diffstat (limited to 'gcc/fortran/trans-stmt.c')
-rw-r--r--gcc/fortran/trans-stmt.c30
1 files changed, 8 insertions, 22 deletions
diff --git a/gcc/fortran/trans-stmt.c b/gcc/fortran/trans-stmt.c
index 1fdb059..8e43f4d 100644
--- a/gcc/fortran/trans-stmt.c
+++ b/gcc/fortran/trans-stmt.c
@@ -3023,13 +3023,8 @@ compute_inner_temp_size (gfc_expr *expr1, gfc_expr *expr2,
/* Walk the RHS of the expression. */
*rss = gfc_walk_expr (expr2);
if (*rss == gfc_ss_terminator)
- {
- /* The rhs is scalar. Add a ss for the expression. */
- *rss = gfc_get_ss ();
- (*rss)->next = gfc_ss_terminator;
- (*rss)->type = GFC_SS_SCALAR;
- (*rss)->expr = expr2;
- }
+ /* The rhs is scalar. Add a ss for the expression. */
+ *rss = gfc_get_scalar_ss (gfc_ss_terminator, expr2);
/* Associate the SS with the loop. */
gfc_add_ss_to_loop (&loop, *lss);
@@ -4064,13 +4059,10 @@ gfc_trans_where_assign (gfc_expr *expr1, gfc_expr *expr2,
/* Walk the rhs. */
rss = gfc_walk_expr (expr2);
if (rss == gfc_ss_terminator)
- {
- /* The rhs is scalar. Add a ss for the expression. */
- rss = gfc_get_ss ();
- rss->where = 1;
- rss->next = gfc_ss_terminator;
- rss->type = GFC_SS_SCALAR;
- rss->expr = expr2;
+ {
+ /* The rhs is scalar. Add a ss for the expression. */
+ rss = gfc_get_scalar_ss (gfc_ss_terminator, expr2);
+ rss->where = 1;
}
/* Associate the SS with the loop. */
@@ -4508,11 +4500,8 @@ gfc_trans_where_3 (gfc_code * cblock, gfc_code * eblock)
tsss = gfc_walk_expr (tsrc);
if (tsss == gfc_ss_terminator)
{
- tsss = gfc_get_ss ();
+ tsss = gfc_get_scalar_ss (gfc_ss_terminator, tsrc);
tsss->where = 1;
- tsss->next = gfc_ss_terminator;
- tsss->type = GFC_SS_SCALAR;
- tsss->expr = tsrc;
}
gfc_add_ss_to_loop (&loop, tdss);
gfc_add_ss_to_loop (&loop, tsss);
@@ -4526,11 +4515,8 @@ gfc_trans_where_3 (gfc_code * cblock, gfc_code * eblock)
esss = gfc_walk_expr (esrc);
if (esss == gfc_ss_terminator)
{
- esss = gfc_get_ss ();
+ esss = gfc_get_scalar_ss (gfc_ss_terminator, esrc);
esss->where = 1;
- esss->next = gfc_ss_terminator;
- esss->type = GFC_SS_SCALAR;
- esss->expr = esrc;
}
gfc_add_ss_to_loop (&loop, edss);
gfc_add_ss_to_loop (&loop, esss);