From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id DB16F3858D37; Fri, 3 Nov 2023 11:09:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DB16F3858D37 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1699009751; bh=wdzZfdsY26rVBrJ0JvlY4l8pc41IHg7BJWrbgOpWRWA=; h=From:To:Subject:Date:From; b=iecMFZaPyit9Ic9y0nXHtQTm4ZAqdY1JxfBlLvpr62qqA0lfqOJqfWM8I8xVNy0Hs UIupSpBEpKEm03kXkKrjuahGYv/DYKWmoS0yWmnIwFb19MXieN+sj9X/WxJhFBUeU2 2unrGTUIyyXfQn3MgVFzcI6NwgH0xETqg42ZywFQ= From: "zimmerma+gcc at loria dot fr" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/112367] New: wrong rounding of sum of floating-point constants Date: Fri, 03 Nov 2023 11:09:11 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: 6.3.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: zimmerma+gcc at loria dot fr X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D112367 Bug ID: 112367 Summary: wrong rounding of sum of floating-point constants Product: gcc Version: 6.3.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: zimmerma+gcc at loria dot fr Target Milestone: --- The following code: #include #include #pragma STDC FENV_ACCESS ON int main() { fesetround (FE_UPWARD); float x =3D 0x1.e90026p+4f + 0x1.fp-21; printf ("x=3D%a\n", x); } yields on cfarm117 with gcc 6.3.0: zimmerma@cfarm117:~/core-math$ gcc -frounding-math e.c -lm; ./a.out x=3D0x1.e90026p+4 whereas one would expect 0x1.e90028p+4. I don't have access to an ARM machine with a recent version of gcc.=