diff options
Diffstat (limited to 'gcc/convert.c')
-rw-r--r-- | gcc/convert.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/convert.c b/gcc/convert.c index 118889f..0a9743a 100644 --- a/gcc/convert.c +++ b/gcc/convert.c @@ -248,10 +248,12 @@ convert_to_real (tree type, tree expr) if (itype != type && FLOAT_TYPE_P (type)) switch (TREE_CODE (expr)) { - /* Convert (float)-x into -(float)x. This is always safe. */ + /* Convert (float)-x into -(float)x. This is safe for + round-to-nearest rounding mode. */ case ABS_EXPR: case NEGATE_EXPR: - if (TYPE_PRECISION (type) < TYPE_PRECISION (TREE_TYPE (expr))) + if (!flag_rounding_math + && TYPE_PRECISION (type) < TYPE_PRECISION (TREE_TYPE (expr))) return build1 (TREE_CODE (expr), type, fold (convert_to_real (type, TREE_OPERAND (expr, 0)))); |