From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id CC646385115F; Fri, 26 Aug 2022 18:14:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CC646385115F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1661537646; bh=BZtORe4WUx6piF1qKBudTzNicKBsuWhOUDuBe/EXBeE=; h=From:To:Subject:Date:In-Reply-To:References:From; b=TDVt7IJrvzg3gTEEsmoZQtCQtQRlCWcVkFUu0/KCxgM/AewXWG8GuOSOXKVBt9pNH xBwIKW4A7K8yGOc+BtmLZ0PIj4WJ91zM7rlQlSWyxjsiZJfVWzPe9LAD9Y5ZyCt5pu +zRHEWtSXjWkfKCuJfGboEp5hiLoNC598CkFBWHU= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/106751] internal compiler error: in purge_dead_edges with inline-asm goto Date: Fri, 26 Aug 2022 18:14:06 +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: 12.2.0 X-Bugzilla-Keywords: ice-on-valid-code, inline-asm, needs-bisection 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: cf_gcctarget component 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=3D106751 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- Target|powerpc64-linux |powerpc64-linux, | |aarch64-linux-gnu Component|middle-end |rtl-optimization --- Comment #5 from Andrew Pinski --- loop2_invariant moves the instruction. You can also reproduce the failure on aarch64 with the following: ``` struct task_struct; struct task_struct *get_current(); struct task_struct { int __state; }; void f() { asm goto("# %0" : : : : __label_warn_on); __builtin_unreachable(); __label_warn_on: while (1) get_current()->__state =3D 1; } ``` Which changes 0 for 1(on aarch64, zero can be used for a store which is why= it works for 0). It works on x86_64 because the move accepts the 1. Note on the trunk, the ICE is the following: : In function 'void f()': :12:1: error: in basic block 2: 12 | } | ^ :12:1: error: flow control insn inside a basic block (jump_insn 5 2 12 2 (asm_operands/v ("# %0") ("") 0 [] [] [ (label_ref:DI 8) ] :7) "":7:3 -1 (nil) -> 8) during RTL pass: loop2_invariant dump file: /app/output.cpp.272r.loop2_invariant :12:1: internal compiler error: in rtl_verify_bb_insns, at cfgrtl.cc:2797 Please submit a full bug report, with preprocessed source (by using -freport-bug). See for instructions. Compiler returned: 1=