From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 4F03C3858416; Wed, 22 May 2024 08:49:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4F03C3858416 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1716367793; bh=F4zWgGqodCE0jlnAlwYYe/mCKWrCJp87jnAJV20Ee5E=; h=From:To:Subject:Date:In-Reply-To:References:From; b=tTU/zvljgNWq/PhoRY+XepjevzngoSgs1CsYpM7AssQ2R8qstimLAaCkyk0jZp3s3 c53nG7ON9ElqLsqA+NAQemFRq0/VhM12LFjt/EQrlf2PELILfzZFhWrQfE2SwgcjSh Wy/A799x7pVh7E6NWcnXgK+cTh84m687O/R9lpwE= From: "amonakov at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/115161] [15 Regression] highway-1.0.7 miscompilation of some SSE2 intrinsics Date: Wed, 22 May 2024 08:49:51 +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: 15.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: amonakov at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 15.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=3D115161 --- Comment #20 from Alexander Monakov --- (In reply to Jakub Jelinek from comment #19) > If we guarantee that we never constant fold FIX/UNSIGNED_FIX with > -ftrapping-math (we shouldn't, as the exceptions should be raised), then > using FIX/UNSIGNED_FIX is ok in > flag_trapping_math guarded patterns even if the intrinsics have some > specific value they want in those cases, because they will never be folde= d. No, this sounds illogical. The compiler may fold out-of-range conversions j= ust fine, it just needs to preserve the original operation (with its result now dead), or use any other opportunity to ensure that exceptions are still rai= sed. Specifically, it is okay to transform float f; int i; f =3D 0x0.8p+33f; i =3D (int) f; to f =3D 0x0.8p+33f; dummy =3D (int) f; i =3D INT_MAX; // or whatever The "known" value of 'i' may then facilitate further folding.=