From c68cdfac5b85560441d585d4151f65812180821b Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Tue, 26 May 2015 20:19:55 +0000 Subject: [PATCH] trans.c (Attribute_to_gnu): Do not apply extra-precision trick to literals. * gcc-interface/trans.c (Attribute_to_gnu) : Do not apply extra-precision trick to literals. Build SAVE_EXPR manually. * gcc-interface/misc.c (enumerate_modes): Add bypass for x86/x86-64. From-SVN: r223715 --- gcc/ada/ChangeLog | 7 +++++++ gcc/ada/gcc-interface/misc.c | 7 ++++++- gcc/ada/gcc-interface/trans.c | 5 +++-- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 12953b8ff22..d6d7af5defa 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,10 @@ +2015-05-26 Eric Botcazou + + * gcc-interface/trans.c (Attribute_to_gnu) : Do not apply + extra-precision trick to literals. Build SAVE_EXPR manually. + + * gcc-interface/misc.c (enumerate_modes): Add bypass for x86/x86-64. + 2015-05-26 Eric Botcazou * gcc-interface/ada-tree.h (DECL_GLOBAL_NONCONSTANT_RENAMING_P): Delete diff --git a/gcc/ada/gcc-interface/misc.c b/gcc/ada/gcc-interface/misc.c index cdd546668dd..9f931dc8aa6 100644 --- a/gcc/ada/gcc-interface/misc.c +++ b/gcc/ada/gcc-interface/misc.c @@ -847,7 +847,12 @@ enumerate_modes (void (*f) (const char *, int, int, int, int, int, int, int)) || fmt == &ieee_extended_intel_96_format || fmt == &ieee_extended_intel_96_round_53_format || fmt == &ieee_extended_intel_128_format) - fp_arith_may_widen = true; + { +#ifdef TARGET_FPMATH_DEFAULT + if (TARGET_FPMATH_DEFAULT == FPMATH_387) +#endif + fp_arith_may_widen = true; + } if (fmt->b == 2) digs = (fmt->p - 1) * 1233 / 4096; /* scale by log (2) */ diff --git a/gcc/ada/gcc-interface/trans.c b/gcc/ada/gcc-interface/trans.c index b3258091947..b1c15516bc6 100644 --- a/gcc/ada/gcc-interface/trans.c +++ b/gcc/ada/gcc-interface/trans.c @@ -2428,7 +2428,8 @@ Attribute_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, int attribute) gnu_result_type = get_unpadded_type (Etype (gnat_node)); gnu_result = convert (gnu_result_type, gnu_expr); - if (fp_arith_may_widen + if (TREE_CODE (gnu_result) != REAL_CST + && fp_arith_may_widen && TYPE_PRECISION (gnu_result_type) < TYPE_PRECISION (longest_float_type_node)) { @@ -2441,7 +2442,7 @@ Attribute_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, int attribute) finish_record_type (rec_type, field, 0, false); rec_val = build_constructor_single (rec_type, field, gnu_result); - rec_val = save_expr (rec_val); + rec_val = build1 (SAVE_EXPR, rec_type, rec_val); asm_expr = build5 (ASM_EXPR, void_type_node, -- 2.30.2