From: Jerry DeLisle Date: Sat, 24 Jun 2017 21:22:08 +0000 (+0000) Subject: re PR fortran/81160 (arith.c:2009: bad statement order ?) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ab3a378a6b3f356e17959ae03aaed54d3ea2d08c;p=gcc.git re PR fortran/81160 (arith.c:2009: bad statement order ?) 2017-06-24 Jerry DeLisle PR fortran/81160 * arith.c (wprecision_int_real): Set return value before mpz_clear and then return after it. From-SVN: r249627 --- diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 8e9e9a66d62..88fd0b327d7 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2017-06-24 Jerry DeLisle + + PR fortran/81160 + * arith.c (wprecision_int_real): Set return value before + mpz_clear and then return after it. + 2017-06-15 Janus Weil PR fortran/80983 diff --git a/gcc/fortran/arith.c b/gcc/fortran/arith.c index 8fa305c6aee..c3be14df522 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. */