gimple-ssa-sprintf.c (format_floating): Simplify the computation of precision to avoid preprocessor conditional.

gcc/ChangeLog:
	* gimple-ssa-sprintf.c (format_floating): Simplify the computation
	of precision to avoid preprocessor conditional.

From-SVN: r244961
This commit is contained in:
Martin Sebor 2017-01-27 02:45:32 +00:00 committed by Martin Sebor
parent c1c3f4f25d
commit 0fb9ec83c3
2 changed files with 9 additions and 14 deletions

View file

@ -1,3 +1,8 @@
2017-01-26 Martin Sebor <msebor@redhat.com>
* gimple-ssa-sprintf.c (format_floating): Simplify the computation
of precision.
2017-01-26 Martin Sebor <msebor@redhat.com>
* gimple-ssa-sprintf.c (format_floating): Test HAVE_XFmode and

View file

@ -1686,20 +1686,10 @@ format_floating (const directive &dir, tree arg)
prec[0] = -1;
if (prec[1] < 0)
{
#ifdef HAVE_XFmode
/* When L is specified use long double, otherwise double. */
unsigned fmtprec
= (dir.modifier == FMT_LEN_L
? REAL_MODE_FORMAT (XFmode)->p
: REAL_MODE_FORMAT (DFmode)->p);
#elif defined HAVE_DFmode
/* No long double support, use double precision for both. */
unsigned fmtprec = REAL_MODE_FORMAT (DFmode)->p;
#else
/* No long double or double support. */
unsigned fmtprec = 0;
#endif
/* The precision of the IEEE 754 double format is 53.
unsigned fmtprec
= REAL_MODE_FORMAT (TYPE_MODE (TREE_TYPE (arg)))->p;
/* The precision of the IEEE 754 double format is 53.
The precision of all other GCC binary double formats
is 56 or less. */
prec[1] = fmtprec <= 56 ? 13 : 15;