From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 019473857C61; Wed, 31 Jan 2024 09:58:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 019473857C61 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1706695133; bh=RI+7OwNzZrYO4I0VO/sK22ZL+3Oaj3fJGHJ9uDHdH7Q=; h=From:To:Subject:Date:In-Reply-To:References:From; b=MdnXGk1v5/Nqls/m/7pZSVU0EelH14gGRvVjxiQZT7X9yApR9GnxNjlfNF9jJcm2d SHO/w8OXl1qQxWrIp9qZMsFD667q0jKIosnV9GqcXdxhh2l+3orKDerLt5V353NT6e 3WX/B26Dkek6nhRsypm5QYbcnPTRd/LzBhTgYyNE= From: "dilyan.palauzov at aegee dot org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/113679] long long minus double with gcc -m32 produces different results than other compilers or gcc -m64 Date: Wed, 31 Jan 2024 09:58:52 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 13.2.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: dilyan.palauzov at aegee dot org X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: DUPLICATE 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: Message-ID: In-Reply-To: References: 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=3D113679 --- Comment #5 from =D0=94=D0=B8=D0=BB=D1=8F=D0=BD =D0=9F=D0=B0=D0=BB=D0=B0= =D1=83=D0=B7=D0=BE=D0=B2 --- gcc -m64 -fexcess-precision=3Dfast -o diff diff.c && ./diff 0.000000 gcc -m32 -fexcess-precision=3Dfast -o diff diff.c && ./diff -2.000000 clang -m32 -fexcess-precision=3Dfast -o diff diff.c && ./diff 0.000000 clang -m64 -fexcess-precision=3Dfast -o diff diff.c && ./diff 0.000000 gcc -m64 -fexcess-precision=3Dstandard -o diff diff.c && ./diff 0.000000 gcc -m32 -fexcess-precision=3Dstandard -o diff diff.c && ./diff 0.000000 clang -m32 -fexcess-precision=3Dstandard -o diff diff.c && ./diff 0.000000 clang -m64 -fexcess-precision=3Dstandard -o diff diff.c && ./diff 0.000000 If this excess precision has justification, why are the results different f= or 32 and 64bit code? With printf("%f\n", (double)l - d); printf("%f\n", (double)(l - d)); there is indeed a difference: $ gcc -m32 -fexcess-precision=3Dstandard -o diff diff.c && ./diff 0.000000 -2.000000=