diff options
author | Aldy Hernandez <aldyh@redhat.com> | 2022-10-05 20:21:07 +0200 |
---|---|---|
committer | Aldy Hernandez <aldyh@redhat.com> | 2022-10-06 08:21:41 +0200 |
commit | ab4909fd8f5f77685e6ec12768c56545347f30c4 (patch) | |
tree | 5200c7590702f1fd976cf338aff33a7d1470f143 /gcc | |
parent | 966010b2eb4a4c52f139b63548533e7bbd74ec9c (diff) | |
download | gcc-ab4909fd8f5f77685e6ec12768c56545347f30c4.zip gcc-ab4909fd8f5f77685e6ec12768c56545347f30c4.tar.gz gcc-ab4909fd8f5f77685e6ec12768c56545347f30c4.tar.bz2 |
Do not double print INF and NAN in frange pretty printer.
gcc/ChangeLog:
* value-range-pretty-print.cc (vrange_printer::print_real_value):
Avoid printing INF and NAN twice.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/value-range-pretty-print.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/value-range-pretty-print.cc b/gcc/value-range-pretty-print.cc index 8cbe97b..3a3b4b4 100644 --- a/gcc/value-range-pretty-print.cc +++ b/gcc/value-range-pretty-print.cc @@ -123,7 +123,11 @@ vrange_printer::print_real_value (tree type, const REAL_VALUE_TYPE &r) const char s[100]; real_to_decimal_for_mode (s, &r, sizeof (s), 0, 1, TYPE_MODE (type)); pp_string (pp, s); - if (!DECIMAL_FLOAT_TYPE_P (type)) + if (!DECIMAL_FLOAT_TYPE_P (type) + // real_to_hexadecimal prints infinities and NAN as text. No + // need to print them twice. + && !real_isinf (&r) + && !real_isnan (&r)) { real_to_hexadecimal (s, &r, sizeof (s), 0, 1); pp_printf (pp, " (%s)", s); |