From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 7A1C43858403; Fri, 9 Feb 2024 09:15:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7A1C43858403 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1707470111; bh=7Afq43Nx98Tp/9wv0biRG2YKZeUY/NXqc3YjkAFNhUM=; h=From:To:Subject:Date:In-Reply-To:References:From; b=JiMUSngSugZd0Rlt6f7TCHcKKA5Z4ccNvzBqFB5Ym52zGxLJjjiQx7R5sQiJlRxrP tFfqQnVqQ0WXGBLOPbkn6eJjWtEC22M0Wu4yE0ghdt/E4L6mj//HbwqVZzUa3n7D57 /WVgit4zKUFga2XQj1AAoI1P7qzb/aEAKgAY1yz0= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/110754] assume create spurious load for volatile variable Date: Fri, 09 Feb 2024 09:15:10 +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: 14.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: NEW 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=3D110754 --- Comment #7 from Jakub Jelinek --- For volatile I'm afraid we can't pass n as an argument to the magic functio= n, perhaps we could pass its address to it and do the load in there. Perhaps ditto for the atomics (that is C only of course), but that likely is what happens already. Sure, most likely such assumptions won't be really useful for anything, but one could still say volatile int n =3D p; int m =3D 0; [[assume (p =3D=3D (n & m))]]; if (p !=3D 0) ... or similar.=