From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id DB384385840D; Fri, 5 Apr 2024 04:10:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DB384385840D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1712290223; bh=kWQwCS+38+qOoaMxPGWwAu2oLAu/WuEQeApjOIKDvXw=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Rb9p5iV3Q/PCnLcQRZvxY5OQ5yNvMD0YFJ0oDWc5inn+cSu+BRdMqpJrjG4vHii3p 9p0lCak4SSy1r7a8eI28tu0wRK+Jg3YzKjOOtu1Ep0gTfZ9TL+CQSvt/KNZs6hj71T PTeBfJ4t6WhvumxFb/w7nZgKP/5f/7fCJvQ0B/tg= From: "141242068 at smail dot nju.edu.cn" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/114597] [GCC-14] Miscompilation of pointer assignment with inline assembly Date: Fri, 05 Apr 2024 04:10:21 +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: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: 141242068 at smail dot nju.edu.cn 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=3D114597 --- Comment #3 from wierton <141242068 at smail dot nju.edu.cn> --- Thanks a lot, I have checked it out. I'm still somewhat confused. Does the difference in compilation stem from G= CC interpreting "=3Dm" and "=3Dr" differently, leading it to assume that once = "n.p" is declared as an output operand without matched input declaration (eg. "=3Dm" expects "m", "=3Dr" expects "r"), its value is expected to change? ``` asm("":"=3Dm"(n.p):"r"(n.p)); // n.p is expected to change asm("":"=3Dr"(n.p):"r"(n.p)); // n.p can retain its value asm("":"=3Dm"(n.p):"m"(n.p)); // n.p can retain its value ``` Thanks in advance for any further explanation you can provide.=