summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormikael <mikael@138bc75d-0d04-0410-961f-82ee72b054a4>2010-10-06 15:59:31 +0000
committermikael <mikael@138bc75d-0d04-0410-961f-82ee72b054a4>2010-10-06 15:59:31 +0000
commit1f2a3eec0ab53881cdccf10ed92321a0a71c0d0b (patch)
tree1e4489346bf74d625a3d7f75b6972c82f5b92e10
parent4671339cb445299eddc7612bceedf25bccaeaa49 (diff)
downloadgcc-1f2a3eec0ab53881cdccf10ed92321a0a71c0d0b.tar.gz
2010-10-06 Mikael Morin <mikael@gcc.gnu.org>
* trans-array.c (gfc_conv_tmp_array_ref): Add factorized call to gfc_advance_se_ss_chain. * trans-expr.c (gfc_conv_subref_array_ref, gfc_conv_procedure_call, gfc_conv_array_constructor_expr, gfc_trans_assignment_1): Remove calls to gfc_advance_se_ss_chain after gfc_conv_tmp_array_ref. * trans-intrinsic.c (gfc_conv_intrinsic_function): Ditto. * trans-stmt.c (gfc_trans_where_assign, gfc_trans_where_3): Ditto. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@165046 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/fortran/ChangeLog10
-rw-r--r--gcc/fortran/trans-array.c1
-rw-r--r--gcc/fortran/trans-expr.c5
-rw-r--r--gcc/fortran/trans-intrinsic.c7
-rw-r--r--gcc/fortran/trans-stmt.c18
5 files changed, 17 insertions, 24 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 384842dc30a..4c8cec42321 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,5 +1,15 @@
2010-10-06 Mikael Morin <mikael@gcc.gnu.org>
+ * trans-array.c (gfc_conv_tmp_array_ref): Add factorized call to
+ gfc_advance_se_ss_chain.
+ * trans-expr.c (gfc_conv_subref_array_ref, gfc_conv_procedure_call,
+ gfc_conv_array_constructor_expr, gfc_trans_assignment_1): Remove
+ calls to gfc_advance_se_ss_chain after gfc_conv_tmp_array_ref.
+ * trans-intrinsic.c (gfc_conv_intrinsic_function): Ditto.
+ * trans-stmt.c (gfc_trans_where_assign, gfc_trans_where_3): Ditto.
+
+2010-10-06 Mikael Morin <mikael@gcc.gnu.org>
+
* trans.c (gfc_restore_backend_locus): New function.
(gfc_get_backend_locus): Renamed to ...
(gfc_save_backend_locus): ... this.
diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c
index 271b37cf80f..f70d16e0ea7 100644
--- a/gcc/fortran/trans-array.c
+++ b/gcc/fortran/trans-array.c
@@ -2552,6 +2552,7 @@ gfc_conv_tmp_array_ref (gfc_se * se)
{
se->string_length = se->ss->string_length;
gfc_conv_scalarized_array_ref (se, NULL);
+ gfc_advance_se_ss_chain (se);
}
diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c
index a6837c95e90..d662d200208 100644
--- a/gcc/fortran/trans-expr.c
+++ b/gcc/fortran/trans-expr.c
@@ -2354,7 +2354,6 @@ gfc_conv_subref_array_arg (gfc_se * parmse, gfc_expr * expr, int g77,
gfc_conv_expr (&rse, expr);
gfc_conv_tmp_array_ref (&lse);
- gfc_advance_se_ss_chain (&lse);
if (intent != INTENT_OUT)
{
@@ -2829,7 +2828,6 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym,
/* Access the previously obtained result. */
gfc_conv_tmp_array_ref (se);
- gfc_advance_se_ss_chain (se);
return 0;
}
}
@@ -3977,7 +3975,6 @@ gfc_conv_array_constructor_expr (gfc_se * se, gfc_expr * expr)
gcc_assert (se->ss->expr == expr && se->ss->type == GFC_SS_CONSTRUCTOR);
gfc_conv_tmp_array_ref (se);
- gfc_advance_se_ss_chain (se);
}
@@ -5679,7 +5676,6 @@ gfc_trans_assignment_1 (gfc_expr * expr1, gfc_expr * expr2, bool init_flag,
if (l_is_temp)
{
gfc_conv_tmp_array_ref (&lse);
- gfc_advance_se_ss_chain (&lse);
if (expr2->ts.type == BT_CHARACTER)
lse.string_length = string_length;
}
@@ -5730,7 +5726,6 @@ gfc_trans_assignment_1 (gfc_expr * expr1, gfc_expr * expr2, bool init_flag,
lse.ss = lss;
gfc_conv_tmp_array_ref (&rse);
- gfc_advance_se_ss_chain (&rse);
gfc_conv_expr (&lse, expr1);
gcc_assert (lse.ss == gfc_ss_terminator
diff --git a/gcc/fortran/trans-intrinsic.c b/gcc/fortran/trans-intrinsic.c
index 6e9bfaf8b36..a43bfc291fa 100644
--- a/gcc/fortran/trans-intrinsic.c
+++ b/gcc/fortran/trans-intrinsic.c
@@ -6089,11 +6089,8 @@ gfc_conv_intrinsic_function (gfc_se * se, gfc_expr * expr)
case GFC_ISYM_TRANSFER:
if (se->ss && se->ss->useflags)
- {
- /* Access the previously obtained result. */
- gfc_conv_tmp_array_ref (se);
- gfc_advance_se_ss_chain (se);
- }
+ /* Access the previously obtained result. */
+ gfc_conv_tmp_array_ref (se);
else
gfc_conv_intrinsic_transfer (se, expr);
break;
diff --git a/gcc/fortran/trans-stmt.c b/gcc/fortran/trans-stmt.c
index 82cddd7c226..12ebe4ab54b 100644
--- a/gcc/fortran/trans-stmt.c
+++ b/gcc/fortran/trans-stmt.c
@@ -3740,10 +3740,7 @@ gfc_trans_where_assign (gfc_expr *expr1, gfc_expr *expr2,
/* Translate the expression. */
gfc_conv_expr (&rse, expr2);
if (lss != gfc_ss_terminator && loop.temp_ss != NULL)
- {
- gfc_conv_tmp_array_ref (&lse);
- gfc_advance_se_ss_chain (&lse);
- }
+ gfc_conv_tmp_array_ref (&lse);
else
gfc_conv_expr (&lse, expr1);
@@ -3796,7 +3793,6 @@ gfc_trans_where_assign (gfc_expr *expr1, gfc_expr *expr2,
lse.ss = lss;
gfc_conv_tmp_array_ref (&rse);
- gfc_advance_se_ss_chain (&rse);
gfc_conv_expr (&lse, expr1);
gcc_assert (lse.ss == gfc_ss_terminator
@@ -4201,10 +4197,7 @@ gfc_trans_where_3 (gfc_code * cblock, gfc_code * eblock)
gfc_conv_expr (&tsse, tsrc);
if (tdss != gfc_ss_terminator && loop.temp_ss != NULL)
- {
- gfc_conv_tmp_array_ref (&tdse);
- gfc_advance_se_ss_chain (&tdse);
- }
+ gfc_conv_tmp_array_ref (&tdse);
else
gfc_conv_expr (&tdse, tdst);
@@ -4212,12 +4205,9 @@ gfc_trans_where_3 (gfc_code * cblock, gfc_code * eblock)
{
gfc_conv_expr (&esse, esrc);
if (edss != gfc_ss_terminator && loop.temp_ss != NULL)
- {
- gfc_conv_tmp_array_ref (&edse);
- gfc_advance_se_ss_chain (&edse);
- }
+ gfc_conv_tmp_array_ref (&edse);
else
- gfc_conv_expr (&edse, edst);
+ gfc_conv_expr (&edse, edst);
}
tstmt = gfc_trans_scalar_assign (&tdse, &tsse, tdst->ts, false, false, true);