From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B7EEE38B97C0; Thu, 6 Jun 2024 19:32:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B7EEE38B97C0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1717702334; bh=/FKRpFbmBQ91hvbqcRXnrHOOe8ioknuHci88F+qFWCw=; h=From:To:Subject:Date:In-Reply-To:References:From; b=NEBoqIN2aQ4vnu0EVxA0ZHXxv37BLLOe/s+Yevh/gPwvFir3IfXVhBEuyvAKiO8xj 5egMQzDCqeUEZ2Is70k9rNjRZIyACbsl3pQA22I3EAzcFhReaZO08bs7b9PF/3N8lV PJtdcG5CHtpHGRqiAWMOVh9+WND0mLZKiHPkW6xw= From: "ubizjak at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/115374] fmod() in x86_64 -O3 not using return value from the glibc's implementation if x87 FPU fprem returns NaN Date: Thu, 06 Jun 2024 19:32:14 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: 14.1.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: ubizjak at gmail dot com X-Bugzilla-Status: WAITING 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: 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=3D115374 --- Comment #8 from Uro=C5=A1 Bizjak --- When compiling the following testcase: --cut here-- #include double __attribute__((noinline)) do_fmod (double x, double y) { return fmod(x, y); } --cut here-- one can find in _.265t.optimized: __attribute__((noinline)) double do_fmod (double x, double y) { double _5; [local count: 1073741824]: _5 =3D .FMOD (x_2(D), y_3(D)); if (_5 =3D=3D _5) goto ; [99.95%] else goto ; [0.05%] [local count: 536864]: fmod (x_2(D), y_3(D)); [local count: 1073741824]: return _5; }=