Patchwork [fortran] coarray cleanup leftover

login
register
mail settings
Submitter Mikael Morin
Date Nov. 24, 2011, 11:06 p.m.
Message ID <201111250006.08939.mikael.morin@sfr.fr>
Download mbox | patch
Permalink /patch/127626/
State New
Headers show

Comments

Mikael Morin - Nov. 24, 2011, 11:06 p.m.
Hello,

This change
http://gcc.gnu.org/viewcvs?view=revision&revision=179689
removed references to gfc_loopinfo's codimen field and one conditional 
checking against gfc_loopinfo::dimen (as we had the convention that dimensions 
above dimen were codimensions).
I have noticed two more of those conditionals which I'm proposing for removal.

This is not a bug nor a regression, so this should normally wait for the next 
stage1. It is obvious on the other hand, and safe, as the 'n < loop->dimen' 
conditions are inside a 'for (n = 0; n < loop->dimen; n++)' loop.

Regression tested on x86_64-unknown-linux-gnu (with the just posted pr51250 
patch). OK for trunk?

Mikael
2011-11-24  Mikael Morin  <mikael@gcc.gnu.org>

	* trans-array.c (set_loop_bounds): Remove dead conditions.
Tobias Burnus - Nov. 25, 2011, 6:58 a.m.
Mikael Morin wrote:
> This is not a bug nor a regression, so this should normally wait for the next
> stage1. It is obvious on the other hand, and safe, as the 'n<  loop->dimen'
> conditions are inside a 'for (n = 0; n<  loop->dimen; n++)' loop.
>
> Regression tested on x86_64-unknown-linux-gnu (with the just posted pr51250
> patch). OK for trunk?

OK. Thanks for the clean up.

Tobias

Patch

diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c
index 2fb2d34..ee8f896 100644
--- a/gcc/fortran/trans-array.c
+++ b/gcc/fortran/trans-array.c
@@ -4341,9 +4341,9 @@  set_loop_bounds (gfc_loopinfo *loop)
 	}
 
       /* Transform everything so we have a simple incrementing variable.  */
-      if (n < loop->dimen && integer_onep (info->stride[dim]))
+      if (integer_onep (info->stride[dim]))
 	info->delta[dim] = gfc_index_zero_node;
-      else if (n < loop->dimen)
+      else
 	{
 	  /* Set the delta for this section.  */
 	  info->delta[dim] = gfc_evaluate_now (loop->from[n], &loop->pre);