From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E97593858D38; Mon, 9 Jan 2023 11:46:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E97593858D38 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1673264778; bh=Hh7WBuTHo81aLnM1OJsVp4I9u1zvN9rp/TRZ6u0bdcE=; h=From:To:Subject:Date:In-Reply-To:References:From; b=FeVAh2K7pTQbhSzPVF2K6sQ6yQO6taM9eBruhdqWfdbomUdnVGyoZ+jLocUMeZApA +7LE+UH1hQaZ5dL5W97ObTgOo+q259ZRUjz5aem0KB3AQmlq6Lv314ktsdBwyxdJut NA67pDnIcXRHn4/s4AchHmzAUwGMvBu9mbQ5fpe8= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/69482] Writing through pointers to volatile not always preserved Date: Mon, 09 Jan 2023 11:46:15 +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: 5.3.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: major X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: rguenth at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_status assigned_to 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=3D69482 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED Assignee|unassigned at gcc dot gnu.org |rguenth at gcc dot = gnu.org --- Comment #8 from Richard Biener --- Note we do expand volatile qualified variables to memory but this case is a= bout non-volatile qualified variables stored to through volatile qualified point= ers. So it's int foo (int i) { volatile int j =3D i; return j; } vs. int bar (int i) { int j; *(volatile int *)&j =3D i; return j; } I have a patch.=