aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran
diff options
context:
space:
mode:
authorPaul Thomas <pault@gcc.gnu.org>2007-03-08 09:09:38 +0000
committerPaul Thomas <pault@gcc.gnu.org>2007-03-08 09:09:38 +0000
commite1e24dc19fdafe3b4f3546036c7ffe27e7fa458e (patch)
tree4cb8e99c383163f57a3dbf5b820f948d8303dd4e /gcc/fortran
parent1916c916caf5b22b43ba62974586ffbd3b89b406 (diff)
downloadgcc-e1e24dc19fdafe3b4f3546036c7ffe27e7fa458e.zip
gcc-e1e24dc19fdafe3b4f3546036c7ffe27e7fa458e.tar.gz
gcc-e1e24dc19fdafe3b4f3546036c7ffe27e7fa458e.tar.bz2
re PR fortran/31011 ([4.2 and 4.1 only] Incorrect error: parameter array sections)
2007-03-08 Paul Thomas <pault@gcc.gnu.org> PR fortran/31011 * expr.c (find_array_section): Correct arithmetic for section size. 2007-03-08 Paul Thomas <pault@gcc.gnu.org> PR fortran/31011 * gfortran.dg/parameter_array_section_2.f90: New test. From-SVN: r122689
Diffstat (limited to 'gcc/fortran')
-rw-r--r--gcc/fortran/ChangeLog6
-rw-r--r--gcc/fortran/expr.c3
2 files changed, 7 insertions, 2 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index cbdf82d..987bc50 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,9 @@
+2007-03-08 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/31011
+ * expr.c (find_array_section): Correct arithmetic for section
+ size.
+
2007-03-07 Brooks Moses <brooks.moses@codesourcery.com>
* iresolve.c (gfc_resolve_ishftc): Correct s_kind value.
diff --git a/gcc/fortran/expr.c b/gcc/fortran/expr.c
index dbe5188..06f4d20 100644
--- a/gcc/fortran/expr.c
+++ b/gcc/fortran/expr.c
@@ -1137,8 +1137,7 @@ find_array_section (gfc_expr *expr, gfc_ref *ref)
}
/* Calculate the number of elements and the shape. */
- mpz_abs (tmp_mpz, stride[d]);
- mpz_div (tmp_mpz, stride[d], tmp_mpz);
+ mpz_set (tmp_mpz, stride[d]);
mpz_add (tmp_mpz, end[d], tmp_mpz);
mpz_sub (tmp_mpz, tmp_mpz, ctr[d]);
mpz_div (tmp_mpz, tmp_mpz, stride[d]);