aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikael Morin <mikael@gcc.gnu.org>2012-08-02 19:37:00 +0000
committerMikael Morin <mikael@gcc.gnu.org>2012-08-02 19:37:00 +0000
commit96b2ffe1a17c8d1b6d0b94590d44aea39877e2b1 (patch)
tree1b2dc55f54222f956396043f3e3051853ddcdf26
parent17aa6ab611c5e5ea4d7696aae0866b628fedb4b9 (diff)
downloadgcc-96b2ffe1a17c8d1b6d0b94590d44aea39877e2b1.zip
gcc-96b2ffe1a17c8d1b6d0b94590d44aea39877e2b1.tar.gz
gcc-96b2ffe1a17c8d1b6d0b94590d44aea39877e2b1.tar.bz2
trans-array.c (set_loop_bounds): Remove useless dimension check.
* trans-array.c (set_loop_bounds): Remove useless dimension check. Don't update loopspec if it would loose the wanted stride criterion. From-SVN: r190096
-rw-r--r--gcc/fortran/ChangeLog5
-rw-r--r--gcc/fortran/trans-array.c9
2 files changed, 11 insertions, 3 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 036e973..5f3038a 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,5 +1,10 @@
2012-08-02 Mikael Morin <mikael@gcc.gnu.org>
+ * trans-array.c (set_loop_bounds): Remove useless dimension check.
+ Don't update loopspec if it would loose the wanted stride criterion.
+
+2012-08-02 Mikael Morin <mikael@gcc.gnu.org>
+
* trans-array.h (gfc_conv_descriptor_rank): New prototype.
* trans-array.c (gfc_conv_descriptor_rank): New function moved and
renamed ...
diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c
index abdb9ea..feb35df 100644
--- a/gcc/fortran/trans-array.c
+++ b/gcc/fortran/trans-array.c
@@ -4469,8 +4469,7 @@ set_loop_bounds (gfc_loopinfo *loop)
known lower bound
known upper bound
*/
- else if ((loopspec[n]->info->type == GFC_SS_CONSTRUCTOR && dynamic[n])
- || n >= loop->dimen)
+ else if (loopspec[n]->info->type == GFC_SS_CONSTRUCTOR && dynamic[n])
loopspec[n] = ss;
else if (integer_onep (info->stride[dim])
&& !integer_onep (specinfo->stride[spec_dim]))
@@ -4479,7 +4478,11 @@ set_loop_bounds (gfc_loopinfo *loop)
&& !INTEGER_CST_P (specinfo->stride[spec_dim]))
loopspec[n] = ss;
else if (INTEGER_CST_P (info->start[dim])
- && !INTEGER_CST_P (specinfo->start[spec_dim]))
+ && !INTEGER_CST_P (specinfo->start[spec_dim])
+ && integer_onep (info->stride[dim])
+ == integer_onep (specinfo->stride[dim])
+ && INTEGER_CST_P (info->stride[dim])
+ == INTEGER_CST_P (specinfo->stride[dim]))
loopspec[n] = ss;
/* We don't work out the upper bound.
else if (INTEGER_CST_P (info->finish[n])