Commit d289e37a by Richard Henderson Committed by Richard Henderson

re PR rtl-optimization/23941 (compress_float_constant creates denormals)

        PR 23941
        * real.c (exact_real_truncate): Return false if the format cannot
        represent the number as a normal.

From-SVN: r104424
parent 3c7d0735
2005-09-19 Richard Henderson <rth@redhat.com>
PR 23941
* real.c (exact_real_truncate): Return false if the format cannot
represent the number as a normal.
2005-09-19 Dorit Nuzman <dorit@il.ibm.com>
* tree-ssa-operands.c (swap_tree_operands): Export.
......
......@@ -2399,7 +2399,19 @@ real_value_truncate (enum machine_mode mode, REAL_VALUE_TYPE a)
bool
exact_real_truncate (enum machine_mode mode, const REAL_VALUE_TYPE *a)
{
const struct real_format *fmt;
REAL_VALUE_TYPE t;
int emin2m1;
fmt = REAL_MODE_FORMAT (mode);
gcc_assert (fmt);
/* Don't allow conversion to denormals. */
emin2m1 = (fmt->emin - 1) * fmt->log2_b;
if (REAL_EXP (a) <= emin2m1)
return false;
/* After conversion to the new mode, the value must be identical. */
real_convert (&t, mode, a);
return real_identical (&t, a);
}
......
extern void abort (void);
double d = __FLT_MIN__ / 2.0;
int main()
{
double x = __FLT_MIN__ / 2.0;
if (x != d)
abort ();
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment