From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 966553858439; Mon, 24 Oct 2022 18:59:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 966553858439 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1666637957; bh=10VxlbDfXdG3MsSyK91mmv8JIJy9PzM58m3OHKYTNVw=; h=From:To:Subject:Date:In-Reply-To:References:From; b=TOBSd26mK7RdHYzPm0OgyQNddJMed+NTUsNMS08QrBnZZX5SGmxEPvm+3F0VjlhOY cLObRpJfKKEBKkeOTMPy6j5tWTRGO7IvaPEvGwZZTAJq5hZKTuQQAsOgWbwFVZbGzo GA4bUF22MfQ3iDCcmqlnhA9er9gIzmysVvt9zuLM= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/107385] [asm goto] "=r" vs "+r" for outputs along indirect edges Date: Mon, 24 Oct 2022 18:59:17 +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: 12.0 X-Bugzilla-Keywords: inline-asm X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia 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: bug_status everconfirmed cf_reconfirmed_on 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=3D107385 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Ever confirmed|0 |1 Last reconfirmed| |2022-10-24 --- Comment #1 from Andrew Pinski --- Expand is doing: (insn 3 24 9 6 (set (reg/v:SI 82 [ ]) (const_int 6 [0x6])) "/app/example.cpp":4:7 -1 (nil)) (insn 9 3 14 6 (set (reg/v:SI 82 [ ]) (reg:SI 83 [ x ])) "/app/example.cpp":3:5 -1 (nil)) >From this IR: [local count: 1073741824]: __asm__ goto("//" : "=3Dr" x_2 : : : "bar" ); goto ; [35.00%] [local count: 697932184]: : [local count: 1073741824]: # x_1 =3D PHI bar: Note 6 does not need to be a constant here, it could be anything. I suspect when the inline-asm goto is being expanded, it adds the assignmen= t to reg 82 on all edges going out of the inline-asm but then messing up because there is some extra code due to the phi node.=