From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 9DDE63858024; Mon, 9 Jan 2023 12:31:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9DDE63858024 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1673267516; bh=E3H3O/OMeYfwjcBIzPMuPd3dItv3xWwE26se4pLeZIE=; h=From:To:Subject:Date:In-Reply-To:References:From; b=ipBEQzOrVw4MlrmcopvWZXZMRwOdIM688EwUBMvRK1DLhwXTifuprAFjFXN2A6OEM 2VwGTmwQtGQaHmS2/hYzDqpb2Cr2qmlRo7mkezrsznnRhbnSyamywDHH6tR01LIkui AibLvMFGCDJeyyJzX2F5NJAhptVB04RXAd2PW18s= From: "cvs-commit 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 12:31:55 +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: cvs-commit 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: 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 --- Comment #10 from CVS Commits --- The master branch has been updated by Richard Biener : https://gcc.gnu.org/g:a5a8242153d078f1ebe60f00409415da260a29ee commit r13-5066-ga5a8242153d078f1ebe60f00409415da260a29ee Author: Richard Biener Date: Mon Jan 9 12:46:28 2023 +0100 middle-end/69482 - not preserving volatile accesses The following addresses a long standing issue with not preserving accesses to non-volatile objects through volatile qualified pointers in the case that object gets expanded to a register. The fix is to treat accesses to an object with a volatile qualified access as forcing that object to memory. This issue got more exposed recently so it regressed more since GCC 11. PR middle-end/69482 * cfgexpand.cc (discover_nonconstant_array_refs_r): Volatile qualified accesses also force objects to memory. * gcc.target/i386/pr69482-1.c: New testcase. * gcc.target/i386/pr69482-2.c: Likewise.=