From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D3F5A3857346; Wed, 19 Jul 2023 15:16:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D3F5A3857346 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1689779802; bh=BTXnGHerVutFBF+uKvsKq8Y1TLWDhAkqSucTWZ1zJ4A=; h=From:To:Subject:Date:In-Reply-To:References:From; b=MFjLY1r5VL/6NR6KfJyiYpJOWbaAtbTVq2ermWkYZFz5z6qgYICv2DArHkWproo58 YKf5gT3nRaqulmp7SaE5zR3cb1gS2/75TK5eK0FTYonqZwq9/q0xGmt5PsGLkoVGf3 7yqCCqgcjGg21GeIQjwLLParhWuT9Jk6qfwFuQoQ= From: "ibuclaw at gdcproject dot org" To: gcc-bugs@gcc.gnu.org Subject: [Bug d/110712] d: ICE: verify_gimple_failed (conversion of register to a different size in 'view_convert_expr') Date: Wed, 19 Jul 2023 15:16:42 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: d X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: ibuclaw at gdcproject dot org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: ibuclaw at gdcproject dot 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=3D110712 --- Comment #2 from Iain Buclaw --- (In reply to Richard Biener from comment #1) > this_2(D)->ap =3D VIEW_CONVERT_EXPR(ap_3(D)); >=20 > it looks odd since ap_3(D) is a is_gimple_reg but a struct[1] definitely > would not. Maybe you are missing a dereference here? In C > struct[1] would decay to a pointer so >=20 > this.ap =3D ap; >=20 > wouldn't work (besides that va_list copying requires va_copy). Static arrays in D are passed around by value, rather than decaying to a pointer. However va_list is an inconsistent type on this front. In some D compilers, it's always a pointer type to get around the incompatibility with C/C++ - though this requires locals and fields to be specially initialized before being passed to va_start() or va_copy(). i.e, underneath the hood it does: --- void va_start(T)(out va_list ap, ref T parmn, va_list storage =3D alloca(__va_list_tag.sizeof)) { ap =3D storage; // initialize *ap } void va_copy(out va_list ap, va_list src, va_list storage =3D alloca(__va_list_tag.sizeof)) { ap =3D storage; // copy *src. } --- GDC doesn't do this, rather - in a way that mimics C/C++ - va_list static arrays are decayed to a pointer type when used as a parameter, but semantic= ally it's still treated as a static array. I think some extra errors during the D front-end codegen pass are likely the most appropriate thing to do here, as you say, such things are rejected by C/C++, so GDC ought to reject them too.=