From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 0ADCA3858C2A; Sat, 24 Jun 2023 13:04:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0ADCA3858C2A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1687611876; bh=175nCj7qHSw8L1+WdUe9fu8XgKJxc0EEB/3bDmqbMbA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=ueux8U+go/pbPORuWllTtv70K0BtdH58x5ytsiOA9u18YiopsHfPWmP3za2eWAqbu ED3afuxCfT7XEtb10u8RplTHY+5KyBuJths54/GE3YTSa6oJfYQIKg8m3Khh7Cfnmv Q5Ql681lAkP11v91hyfGJ+2jeJYBFIsLUbGf9K24= From: "juergen.reuter at desy dot de" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/110311] [14 Regression] regression in tree-optimizer Date: Sat, 24 Jun 2023 13:04:35 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: juergen.reuter at desy 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: 14.0 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=3D110311 --- Comment #16 from J=C3=BCrgen Reuter --- It seems that it is this function where the NaNs appear: function mult_mod (a, b, c, m) result (v) real(default), intent(in) :: a real(default), intent(in) :: b real(default), intent(in) :: c real(default), intent(in) :: m real(default) :: v integer :: a1 real(default) :: a2 v =3D a * b + c if (v >=3D two53 .or. v <=3D -two53) then a1 =3D int (a / two17) a2 =3D a - a1 * two17 v =3D mod (a1 * b, m) v =3D v * two17 + a2 * b + c end if v =3D mod (v, m) if (v < 0.0_default) v =3D v + m end function mult_mod particularly mod (v, m) gets evaluated to NaN, even if a replace it with v =3D mod (v0, m) to avoid potential aliasing problems. It appears only in = a very complex setup, not in a 100 line program.=