From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 5C4AF385842C; Tue, 11 Jun 2024 11:07:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5C4AF385842C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1718104051; bh=eNNNTCv8t9wEtwmiIV3EOqwMZYBT3/cGkgO9RYD3mpY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=LdaeqXLQ5AE+TV6O/MOcTQHjUqeqKyJxa7Eqg6Sm3mmhEKm+AeHql4eppXB4K97eY MQqchLFiAeO8kvtjK3TFYpFUpCAisKiEMhFuy6hJJvR9JISBpcglOeoFIsz2ZXQXrS fFp+EzbRg6GyQPD4JqWXR14Pd3pw4AwpiKrvbpfo= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/115426] ICE: in execute_todo, at passes.cc:2138 Date: Tue, 11 Jun 2024 11:07:31 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 15.0 X-Bugzilla-Keywords: ice-on-invalid-code, inline-asm X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: rguenth 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=3D115426 --- Comment #3 from Richard Biener --- I think this is a gimplification failure. 'r' is neither TREE_ADDRESSABLE nor DECL_NOT_GIMPLE_REG and the =3DX constraint results in both allow_reg and allow_mem but we gimplify it as is_gimple_lvalue which should, as the base is a gimple register, emit a component extract to pre_p and a complex build to post_p. gimplify_compound_lval correctly sees this and forces a register argument to the __imag operation but I'm not sure that's enough for lvalues. IIRC a simple __imag x =3D 1; also doesn't have DECL_NOT_GIMPLE_REG on 'x', and gimplify_compound_lval behaves the same. Still we eventually gimplify to _1 =3D REALPART_EXPR ; x =3D COMPLEX_EXPR <_1, 1.0e+0>; D.2772 =3D x; which is done via gimplify_modify_expr_complex_part. That suggests it's gimplify_asm_expr that would need to do this very same thing as we seem to rely on this for correctness. With "=3Dr" we correctly gimplify to __asm__("" : "=3Dr" D.2772); _1 =3D REALPART_EXPR ; r =3D COMPLEX_EXPR <_1, D.2772>; D.2773 =3D r;=