From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 1A6A0385842A; Mon, 8 Jan 2024 19:12:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1A6A0385842A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1704741175; bh=xSHbx49JUiSS+AWfqQKg1pf9zGGhbHHVqAjWty6beGI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=GMtpfi5K/NOdAoPQHJnDAwrin0QKxyYwoWa515RNSNlR4ASE0kmKWpBTpG0p4Vya2 Jn+wvP668afvxmE8KerURvcYXKanmUZu6uq/pH7CMIvOv+qgA7NE8P5Fdu2LoRjduP p/BeZVE3ykI5XwJrQvWxSQYY4ocUq6K4sM57B8A0= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/113280] Strange error for empty inline assembly with +X constraint Date: Mon, 08 Jan 2024 19:12:53 +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: 14.0 X-Bugzilla-Keywords: diagnostic, 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: 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=3D113280 --- Comment #2 from Andrew Pinski --- (In reply to Andrew Pinski from comment #1) > So the problem seems like combine decides somehow to=20 > combine: > ``` > (insn 7 4 9 2 (set (reg/v:SF 100 [ xD.4459 ]) > (plus:SF (reg/v:SF 102 [ aD.4455 ]) > (reg/v:SF 103 [ bD.4456 ]))) "/app/example.cpp":6:7 1043 {add= sf3} > (expr_list:REG_DEAD (reg/v:SF 102 [ aD.4455 ]) > (nil))) > (insn 9 7 10 2 (set (reg:SF 104 [ xD.4459 ]) > (asm_operands:SF ("") ("=3DX") 0 [ > (reg/v:SF 100 [ xD.4459 ]) > ] > [ > (asm_input:SF ("0") /app/example.cpp:8) > ] > [] /app/example.cpp:8)) "/app/example.cpp":8:5 -1 > (expr_list:REG_DEAD (reg/v:SF 100 [ xD.4459 ]) > (nil))) > into: > ``` > (insn 9 7 10 2 (set (reg:SF 104 [ xD.4459 ]) > (asm_operands:SF ("") ("=3DX") 0 [ > (plus:SF (reg:SF 106) > (reg/v:SF 103 [ bD.4456 ])) > ] > [ > (asm_input:SF ("0") /app/example.cpp:8) > ] > [] /app/example.cpp:8)) "/app/example.cpp":8:5 -1 > (expr_list:REG_DEAD (reg:SF 106) > (nil))) > ``` >=20 > But the dump from combine does not make sense: > ``` > Trying 7 -> 9: > 7: r100:SF=3Dr106:SF+r103:SF > REG_DEAD r106:SF > 9: r104:SF=3Dasm_operands > REG_DEAD r100:SF > Failed to match this instruction: > (set (reg:SF 104 [ xD.4459 ]) > (asm_operands:SF ("") ("=3DX") 0 [ > (plus:SF (reg:SF 106) > (reg/v:SF 103 [ bD.4456 ])) > ] > [ > (asm_input:SF ("0") /app/example.cpp:8) > ] > [] /app/example.cpp:8)) > allowing combination of insns 7 and 9 > original costs 8 + 4 =3D 12 > replacement cost 4 > deferring deletion of insn with uid =3D 7. > modifying insn i3 9: r104:SF=3Dasm_operands > REG_DEAD r106:SF > deferring rescan insn with uid =3D 9. > ``` So basically check_asm_operands accepts the insn because the plus matches t= he operand but this is an output operand which does not work as it is not an lvalue ...=