From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 129377 invoked by alias); 26 May 2015 20:20:28 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 129363 invoked by uid 89); 26 May 2015 20:20:28 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.5 required=5.0 tests=AWL,BAYES_50,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 X-HELO: smtp.eu.adacore.com Received: from mel.act-europe.fr (HELO smtp.eu.adacore.com) (194.98.77.210) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Tue, 26 May 2015 20:20:27 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id CFBB628526C2; Tue, 26 May 2015 22:20:22 +0200 (CEST) Received: from smtp.eu.adacore.com ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3hoC8__L0B7w; Tue, 26 May 2015 22:20:22 +0200 (CEST) Received: from polaris.localnet (bon31-6-88-161-99-133.fbx.proxad.net [88.161.99.133]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.eu.adacore.com (Postfix) with ESMTPSA id A951C28526BE; Tue, 26 May 2015 22:20:22 +0200 (CEST) From: Eric Botcazou To: gcc-patches@gcc.gnu.org Cc: Arnaud Charlet , Robert Dewar Subject: Re: [Ada] Ensure consistency of fpt exponentiation results Date: Tue, 26 May 2015 21:31:00 -0000 Message-ID: <3550734.dbQtBZf86h@polaris> User-Agent: KMail/4.7.2 (Linux/3.1.10-1.29-desktop; KDE/4.7.2; x86_64; ; ) In-Reply-To: <20150526103520.GA27917@adacore.com> References: <20150526103520.GA27917@adacore.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="nextPart1964397.PBURDp8do2" Content-Transfer-Encoding: 7Bit X-SW-Source: 2015-05/txt/msg02372.txt.bz2 --nextPart1964397.PBURDp8do2 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Content-length: 754 > This change ensures on all targets that A**B = A**C when B is a small > static constant in the range 0 .. 4 and C is a variable with the same > value. Previously for Float and Long_Float on some targets, this was > not the case. The results given were both within the error bounds that > are allowed by the Ada standard, but it is desirable not to have this > discrepancy. This uncovered a bug in gigi, responsible for === acats tests === FAIL: c44003d Fixed thusly, tested on x86_64-suse-linux, applied on the mainline. 2015-05-26 Eric Botcazou * gcc-interface/trans.c (Attribute_to_gnu) : Do not apply extra-precision trick to literals. Build SAVE_EXPR manually. -- Eric Botcazou --nextPart1964397.PBURDp8do2 Content-Disposition: attachment; filename="p.diff" Content-Transfer-Encoding: 7Bit Content-Type: text/x-patch; charset="utf-8"; name="p.diff" Content-length: 896 Index: gcc-interface/trans.c =================================================================== --- gcc-interface/trans.c (revision 223709) +++ gcc-interface/trans.c (working copy) @@ -2428,7 +2428,8 @@ Attribute_to_gnu (Node_Id gnat_node, tre 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, tre 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, --nextPart1964397.PBURDp8do2--