From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 9FC9F3858D1E; Mon, 30 Jan 2023 18:06:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9FC9F3858D1E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1675102019; bh=zuLlVmxsQ2n75edjvqk3nWUwxbMTMO1wg4duLW1+0A8=; h=From:To:Subject:Date:In-Reply-To:References:From; b=yTIwQLBAKbhBJU1O5weUYjrOyfaFMZ3eC2tMEn7guH7l+MDnXzgjvzC1w4ZRjbfd/ eSk7ExlEvwFB33J+CASDlV2Ism7YFgE3w5ROebeQkq476jxrXtIYfow0ksXjbveCEQ ihLgUUla99IlyMFASvIdkZ7REVA0RV8v3+AjzMq0= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/103979] asm goto is not considered volatile with output operands Date: Mon, 30 Jan 2023 18:06:59 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: rtl-optimization X-Bugzilla-Version: 11.2.0 X-Bugzilla-Keywords: ice-on-valid-code, inline-asm, 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: cc 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=3D103979 Jakub Jelinek changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org --- Comment #3 from Jakub Jelinek --- struct S { char a[64]; }; int foo (void) { struct S s, t; asm goto ("" : "=3Dg" (s) : : : l); t =3D s; asm goto ("" : "=3Dg" (s) : : : l); return s.a[0] + t.a[63]; l: return -1; } also ICEs at -O2, not during fwprop (note, I can't reproduce the #c0 testca= se, neither with trunk nor 11 branch on x86_64-linux), but during sra. I think we shouldn't just follow blindly the docs, but see what e.g. Linux kernel as heavy user of asm goto with outputs (and I think mostly without volatile) wants.=