aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/fortran/ChangeLog6
-rw-r--r--gcc/fortran/arith.c5
2 files changed, 9 insertions, 2 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 8e9e9a6..88fd0b3 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,9 @@
+2017-06-24 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR fortran/81160
+ * arith.c (wprecision_int_real): Set return value before
+ mpz_clear and then return after it.
+
2017-06-15 Janus Weil <janus@gcc.gnu.org>
PR fortran/80983
diff --git a/gcc/fortran/arith.c b/gcc/fortran/arith.c
index 8fa305c..c3be14d 100644
--- a/gcc/fortran/arith.c
+++ b/gcc/fortran/arith.c
@@ -2001,13 +2001,14 @@ wprecision_real_real (mpfr_t r, int from_kind, int to_kind)
static bool
wprecision_int_real (mpz_t n, mpfr_t r)
{
+ bool ret;
mpz_t i;
mpz_init (i);
mpfr_get_z (i, r, GFC_RND_MODE);
mpz_sub (i, i, n);
- return mpz_cmp_si (i, 0) != 0;
+ ret = mpz_cmp_si (i, 0) != 0;
mpz_clear (i);
-
+ return ret;
}
/* Convert integers to integers. */