From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 30E673858D39; Tue, 9 Apr 2024 18:18:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 30E673858D39 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1712686739; bh=yW/Xs8mavSg7Ygr0ixWRR+z3nsxWVGmhI5vIRI6CSwM=; h=From:To:Subject:Date:In-Reply-To:References:From; b=PP9koxsw06DllaUHRNRJwH7WzBwR5WqfrOLSFB4E/CUzyhS2+ubswDLHlPqqUxjyA pFIEoI5cp80tJwNNiZWII4VOERYWMQRQYGcj11qYuWQY3MZ4TeyOFNVTC95cIsE2aq esdNfQ51UPnCgUxp1DZsY85lkiSLNqa7XUiycCOw= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/114659] gcc miscompiles a __builtin_memcpy on i386, leading to wrong results for SNaN Date: Tue, 09 Apr 2024 18:18:58 +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.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia at gcc dot gnu.org 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: component 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=3D114659 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- Component|middle-end |target --- Comment #6 from Andrew Pinski --- I doubt there is not much to be done here. It is a x87 issue where we do the store of the float register stack register to the stack to get 32bits (or 64bit) version. And then load it into a GPR. float t =3D *x; float t1 =3D *y; __builtin_memcpy (&xu.f, &t, sizeof (float)); __builtin_memcpy (&xu.f, &t1, sizeof (float)); Produces exactly the same issue.=