From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E0E4A39C5033; Wed, 17 Jun 2020 19:10:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E0E4A39C5033 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1592421037; bh=trDQHHP2Q5NLzJDp54Ql8nuAYDkVWZEE3T3gC5lmjfk=; h=From:To:Subject:Date:In-Reply-To:References:From; b=s+oGtou7L8Ce5lU6Vq7xSchX5rkdxSqZ9S3g+MZQOxI+9b0GTRm0nJChsfNJeZFJe Z74QSVPh/M3Oj6tQBi+N6Z/qyRfNkjaE3qSxzzwiE6jcAk+Yhq0qJvmOnokmvVUwcg SC4A+gI4+o7IGb5oE6+VoZ1SWREw7W/Mzu6kFCzM= From: "foom at fuhm dot net" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/95722] libatomic crashes on __atomic_load of const object Date: Wed, 17 Jun 2020 19:10:37 +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: 10.1.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: foom at fuhm dot net 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: cc 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jun 2020 19:10:38 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D95722 James Y Knight changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |foom at fuhm dot net --- Comment #1 from James Y Knight --- The fix would be to have libatomic use a lock instead of the lock-free cmpxchg16b instruction to implement atomic_load. But I think this is imposs= ible without causing incompatibility with older GCCs. Older versions of GCC (before GCC 7), and Clang to this day, emitted cmpxch= g16b inline for a 16-byte atomic load when you compile with -mcx16. And thus, unfortunately, I think if libatomic switched to a lock now, it wo= uld not be compatible with those older programs.=