From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 5EB24385E836; Thu, 2 May 2024 19:15:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5EB24385E836 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1714677320; bh=6xeJOEkTICi2mJm2bHEH4Er/x0qHFeC2e6+7IxfY9bM=; h=From:To:Subject:Date:In-Reply-To:References:From; b=dGlcmPFlBfUi4HzTQ3LdveCn2yU8AF85sBW0rM2+lXZGTEUvVMAHNANlS/0ExpRMe uANFbzmsl9De/Q9m0E3Ti2hvXiksRRadEaN7wzQVa037IAdLqd8vxjLU7I8a6DbM8b lIP44bhZzRs9CuvKACh3PAcAUIudzpiSxsHkZvhM= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/114923] gcc ignores escaping pointer and applies invalid optimization Date: Thu, 02 May 2024 19:15:20 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: INVALID 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D114923 --- Comment #6 from Andrew Pinski --- Some resources about memory barriers and why they are needed here (for both= HW and SW): https://en.wikipedia.org/wiki/Memory_barrier https://www.kernel.org/doc/Documentation/memory-barriers.txt https://www.oreilly.com/library/view/linux-device-drivers/0596005903/ch09.h= tml And many more.=