diff options
author | Mikael Morin <mikael.morin@sfr.fr> | 2011-09-08 17:30:39 +0200 |
---|---|---|
committer | Mikael Morin <mikael@gcc.gnu.org> | 2011-09-08 15:30:39 +0000 |
commit | 26f7753013e52c93c6d63bb678b1544da43a2384 (patch) | |
tree | bf1d67ae319908ea0112fe103dc2c1d5de388cdc /gcc/fortran/trans-expr.c | |
parent | a1ae4f435fc547fcae4bf04b6c4efcc310328b3e (diff) | |
download | gcc-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-expr.c')
-rw-r--r-- | gcc/fortran/trans-expr.c | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c index 0e85060..6a33719 100644 --- a/gcc/fortran/trans-expr.c +++ b/gcc/fortran/trans-expr.c @@ -4352,13 +4352,8 @@ gfc_trans_subarray_assign (tree dest, gfc_component * cm, gfc_expr * expr) /* Walk the rhs. */ rss = gfc_walk_expr (expr); 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 = expr; - } + /* The rhs is scalar. Add a ss for the expression. */ + rss = gfc_get_scalar_ss (gfc_ss_terminator, expr); /* Create a SS for the destination. */ lss = gfc_get_array_ss (gfc_ss_terminator, NULL, cm->as->rank, @@ -6158,13 +6153,9 @@ gfc_trans_assignment_1 (gfc_expr * expr1, gfc_expr * expr2, bool init_flag, /* 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->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); gfc_add_ss_to_loop (&loop, rss); |