From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 8BD033858D39; Tue, 14 Mar 2023 20:07:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8BD033858D39 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1678824420; bh=ittgZgNwDXpiQRt1zUh089Ac29eWl6gVgIV+X9pNogo=; h=From:To:Subject:Date:From; b=I+DSxhaKrvQWEZUf+DfNhU4nL5M1XVeI2Rfodx4R44CpNJZ/OP8vyNYByTV5N8lab UaqSAUxk+1qg0FY3GNcoRBW00yjGHwoAa74ZVmJsCUn//RVudUJKam4/meNdqlWZwh RvFF0xT2ruMiNveXzMgiHSHJOeGnRUGsoMOjasAU= From: "muecker at gwdg dot de" To: gcc-bugs@gcc.gnu.org Subject: [Bug translation/109132] New: Apple M1 floating point bug when optimizing Date: Tue, 14 Mar 2023 20:07:00 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: translation X-Bugzilla-Version: 12.2.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: muecker at gwdg dot de 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=3D109132 Bug ID: 109132 Summary: Apple M1 floating point bug when optimizing Product: gcc Version: 12.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: translation Assignee: unassigned at gcc dot gnu.org Reporter: muecker at gwdg dot de Target Milestone: --- There seems to be a floating point error when optimizing on Apple M1. When taking the conjugate of a complex number and multiplying with itself, then = the imaginary part should be zero. % cat bug.c=20=20=20=20=20=20=20=20=20 #include #include __attribute__((noinline)) complex float f(complex float a, complex float b) { return a * conjf(b); } int main() { complex float x =3D -0x1.f5cf72p-3 + 0x1.f0f84ap-2i; complex float y =3D f(x, x); printf("%a %a\n", crealf(y), cimagf(y)); return (0. !=3D cimagf(y)); } % gcc-12 bug.c=20=20=20=20=20=20 % ./a.out && echo ok 0x1.2eab1ep-2 0x0p+0 ok % gcc-12 -O1 bug.c=20=20 % ./a.out && echo ok 0x1.2eab1ep-2 0x0p+0 ok % gcc-12 -O2 bug.c=20=20 % ./a.out && echo ok 0x1.2eab1ep-2 0x1.1b990cp-29 % gcc-12 --version gcc-12 (Homebrew GCC 12.2.0) 12.2.0 Copyright (C) 2022 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.=