From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 455D93858D34; Wed, 1 May 2024 22:55:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 455D93858D34 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1714604153; bh=lX9JGsMV+ihiNctPFJCc6csvjzBGXmYF3PYreZE4asA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=oCpaamWFEgCQETeDzlQvhLmcH+olKzOQr5B37pqO2YC8pm9TpuK8ijYsBbQvW9Lca 2V+D12z7Q7TmNKhR2WXU2s8qzZweCgGWD/pLXwejtOeqM4+Ppvy7sde5tIMGUkMBEJ YmHWYFqIY1bcT5ZXtD83k8W7t4e1bHnRjBgU9fU4= From: "jorg.brown at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/114913] "verify_gimple failed" due to addition of two constexpr strings Date: Wed, 01 May 2024 22:55:53 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 15.0 X-Bugzilla-Keywords: ice-checking, ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: jorg.brown at gmail dot com 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=3D114913 --- Comment #4 from Jorg Brown --- Oddly, if I move the reference to HelloWorld into a separate routine, it wo= rks (you can comment out a() and ba() returns what it should, on gcc 15.0) struct strt { const char *ptr =3D &data; char data =3D '\0'; constexpr strt() {} constexpr strt(const strt &__str) {} }; constexpr strt f() { return {}; } constexpr strt HelloWorld =3D f(); // This works fine... const strt &b() { return HelloWorld; } const char *ba() { return b().ptr; } // This causes the verify_gimple failure, on gcc 15 const char *a() { return HelloWorld.ptr; } =3D - =3D - =3D - =3D - =3D - =3D - =3D Also odd is that the above code (including a()) works fine on gcc 10.1 thro= ugh 13.2. As seen https://godbolt.org/z/z3qnosG37=