From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3248 invoked by alias); 7 Feb 2014 23:56:26 -0000 Mailing-List: contact glibc-bugs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: glibc-bugs-owner@sourceware.org Received: (qmail 3224 invoked by uid 48); 7 Feb 2014 23:56:22 -0000 From: "vincent-srcware at vinc17 dot net" To: glibc-bugs@sourceware.org Subject: [Bug libc/6981] __STDC_IEC_559__ should not be defined unconditionally Date: Fri, 07 Feb 2014 23:56:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: libc X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: vincent-srcware at vinc17 dot net X-Bugzilla-Status: RESOLVED X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-02/txt/msg00332.txt.bz2 https://sourceware.org/bugzilla/show_bug.cgi?id=3D6981 --- Comment #9 from Vincent Lef=C3=A8vre --- (In reply to joseph@codesourcery.com from comment #8) > There would be no reason for F.6 and F.10.11 (in C11) if the intent wasn'= t=20 > to support evaluation in wider types. The fact that both F.6 and F.10.11 are new in C11 shows that this is pointl= ess in C99. And I disagree about F.6: you can have double foo (void) { return LDBL_EPSILON; } int main (void) { double x =3D 17.0L * foo (); } I don't think that C99 mandates that LDBL_EPSILON be converted to double if= the eval method is implementation-defined (the arithmetic operations would be correctly rounded as required by IEEE 754, possibly with an extended expone= nt range, but the implementation could decide for C specific operations such as function calls). F.6 in C11 makes the behavior explicit. Concerning F.10.11, there's a contradiction with some codes given earlier in Annex F, which assume FLT_EVAL_METHOD to be 0 or a value with implementation-defined behavior. Now, it is not even clear that the following would be forbidden: FLT_EVAL_METHOD is 1 or 2, but rounding for the arithmetic operations is do= ne in the semantic type. For instance, I suspect that FLT_EVAL_METHOD should b= e 2 with the x87 FPU, even when configured to round to double precision, because the intermediate values still have the extended exponent range (unless the compiler chooses to store the intermediate values to memory). In the C standard, FLT_EVAL_METHOD =3D 2 doesn't imply that the full extended precis= ion is used, just that the intermediate values are representable in long double. > DTS 18661-1 clarifies things further [...] Well, it's more than clarification, it is based on IEEE 754-2008, whose requirements are different from the old IEEE 754-1985 standard: the old requirement I mentioned became obsoleted (replaced) by the use of formatOf operations. But C99 and C11's Annex F is based on the old IEEE 754-1985 standard. --=20 You are receiving this mail because: You are on the CC list for the bug. >>From glibc-bugs-return-21356-listarch-glibc-bugs=sources.redhat.com@sourceware.org Sat Feb 08 00:11:03 2014 Return-Path: Delivered-To: listarch-glibc-bugs@sources.redhat.com Received: (qmail 15604 invoked by alias); 8 Feb 2014 00:11:03 -0000 Mailing-List: contact glibc-bugs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: glibc-bugs-owner@sourceware.org Delivered-To: mailing list glibc-bugs@sourceware.org Received: (qmail 15580 invoked by uid 55); 8 Feb 2014 00:10:59 -0000 From: "joseph at codesourcery dot com" To: glibc-bugs@sourceware.org Subject: [Bug libc/6981] __STDC_IEC_559__ should not be defined unconditionally Date: Sat, 08 Feb 2014 00:11:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: libc X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: joseph at codesourcery dot com X-Bugzilla-Status: RESOLVED X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-02/txt/msg00333.txt.bz2 Content-length: 1816 http://sourceware.org/bugzilla/show_bug.cgi?id=6981 --- Comment #10 from joseph at codesourcery dot com --- On Fri, 7 Feb 2014, vincent-srcware at vinc17 dot net wrote: > Concerning F.10.11, there's a contradiction with some codes given earlier in > Annex F, which assume FLT_EVAL_METHOD to be 0 or a value with > implementation-defined behavior. I don't see what problems you see with any example code in Annex F (but in any case, if there are contradictions - which you should raise as C11 DRs if so - it's natural to try to resolve them in accordance with the clear intent that FLT_EVAL_METHOD being 2 is consistent with Annex F. > Now, it is not even clear that the following would be forbidden: > FLT_EVAL_METHOD is 1 or 2, but rounding for the arithmetic operations is done > in the semantic type. For instance, I suspect that FLT_EVAL_METHOD should be 2 > with the x87 FPU, even when configured to round to double precision, because > the intermediate values still have the extended exponent range (unless the > compiler chooses to store the intermediate values to memory). In the C > standard, FLT_EVAL_METHOD = 2 doesn't imply that the full extended precision is > used, just that the intermediate values are representable in long double. "evaluate all operations and constants to the range and precision of the long double type" seems clear enough to me. If the x87 FPU is rounding to double precision, that's a different ABI, as used on 32-bit FreeBSD, where long double has the extended-precision in-memory encoding but only 53 mantissa bits are used; that ABI isn't supported by glibc (calling libm functions with the FPU rounding to double precision means undefined behavior). -- You are receiving this mail because: You are on the CC list for the bug.