From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 3B91E3858D20; Thu, 2 May 2024 13:56:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3B91E3858D20 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1714658195; bh=Uq+vbHcIQ9Wu9lxVswMYb7ZNF6PvRISp1XhCEj9Lcec=; h=From:To:Subject:Date:In-Reply-To:References:From; b=ZcSNvQsaBsruue0RNscmAZvX9UIudkIi5jI3BNZMl3pnkwXwolJgjierWQ8tgrAVe 53sKAvg4vTyNyT/FH/cKSO1wW9j5HxgjMes+GSJ/U+F5IhLEfIR0C5r+ODVi4TDSFs rKPrtW2OK1JW5U9DSPiMBC5SvhBK93jQtEYpnSLc= From: "amonakov at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/114923] gcc ignores escaping pointer and applies invalid optimization Date: Thu, 02 May 2024 13:56:34 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: amonakov at gcc dot gnu.org 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: 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 #4 from Alexander Monakov --- You can place points of possible access outside of abstract machine in a fine-grained manner with volatile asms: asm volatile("" : "=3Dm"(buf)); This cannot be reordered against accesses to volatile variables and doesn't imply modification of anything except 'buf'.=