From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 9C0CB384B12D; Thu, 12 May 2022 08:58:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9C0CB384B12D From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug other/97309] Improve documentation of -fallow-store-data-races Date: Thu, 12 May 2022 08:58:22 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: other X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: documentation X-Bugzilla-Severity: normal X-Bugzilla-Who: redi at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: FIXED 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 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: Thu, 12 May 2022 08:58:22 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D97309 --- Comment #5 from Jonathan Wakely --- (In reply to Jonathan Wakely from comment #4) > If all accesses to a variable use atomic ops, does that mean it's immune > from the unsafe optimizations enabled by this flag? If no, that makes -Of= ast > unusable in MT code. If yes, good, but why is the flag needed? If there a= re > non-atomic accesses to a variable, we can already assume it's not > concurrently accessed, because any such potentially concurrent conflicting > action would already be a data race and UB. If we already have data races > with UB, can't we just introduce more? Is this flag saying "allow the > compiler to make existing UB even worse"? If not, what is it saying? Or maybe this flag is relevant for languages that don't use the C and C++ memory models, where the rules are different?=