summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2017-01-27 12:28:34 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2017-01-27 12:28:34 +0100
commit89dc4c9488b01debe9c4b0e81fff09bdbd0bdb7b (patch)
tree974cf5ad5fa8235f5181382c64f0255b46732fda
parent6ca513f9b24dacf47db395f4dc41d11037810706 (diff)
downloadgcc-89dc4c9488b01debe9c4b0e81fff09bdbd0bdb7b.tar.gz
realmpfr.h: Poison MPFR_RND{N,Z,U,D}.
* realmpfr.h: Poison MPFR_RND{N,Z,U,D}. * gimple-ssa-sprintf.c (format_floating_max): Use GMP_RNDN instead of MPFR_RNDN. From-SVN: r244966
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/gimple-ssa-sprintf.c2
-rw-r--r--gcc/realmpfr.h7
3 files changed, 13 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 3ef51ca9e8a..2e52f20ecf7 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2017-01-27 Jakub Jelinek <jakub@redhat.com>
+
+ * realmpfr.h: Poison MPFR_RND{N,Z,U,D}.
+ * gimple-ssa-sprintf.c (format_floating_max): Use GMP_RNDN
+ instead of MPFR_RNDN.
+
2017-01-27 Richard Earnshaw <rearnsha@arm.com>
PR target/79239
diff --git a/gcc/gimple-ssa-sprintf.c b/gcc/gimple-ssa-sprintf.c
index bd15a397ccf..8261a442282 100644
--- a/gcc/gimple-ssa-sprintf.c
+++ b/gcc/gimple-ssa-sprintf.c
@@ -1498,7 +1498,7 @@ format_floating_max (tree type, char spec, HOST_WIDE_INT prec)
round-to-nearest mode. */
mpfr_t x;
mpfr_init2 (x, rfmt->p);
- mpfr_from_real (x, &rv, MPFR_RNDN);
+ mpfr_from_real (x, &rv, GMP_RNDN);
/* Return a value one greater to account for the leading minus sign. */
return 1 + get_mpfr_format_length (x, "", prec, spec, 'D');
diff --git a/gcc/realmpfr.h b/gcc/realmpfr.h
index 20c94eaf762..0ea36d2c9ce 100644
--- a/gcc/realmpfr.h
+++ b/gcc/realmpfr.h
@@ -32,5 +32,10 @@ extern void real_from_mpfr (REAL_VALUE_TYPE *, mpfr_srcptr,
const real_format *, mp_rnd_t);
extern void mpfr_from_real (mpfr_ptr, const REAL_VALUE_TYPE *, mp_rnd_t);
-#endif /* ! GCC_REALGMP_H */
+#if (GCC_VERSION >= 3000)
+ /* For compatibility with mpfr 2.4 and earlier, we want to only use
+ GMP_RND*. */
+ #pragma GCC poison MPFR_RNDN MPFR_RNDZ MPFR_RNDU MPFR_RNDD
+#endif
+#endif /* ! GCC_REALGMP_H */