From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 300153858280; Tue, 25 Jul 2023 16:27:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 300153858280 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1690302440; bh=otheqlajnwpSWOYDaR80bfFTwLstqKffkMV+ZEtFXGg=; h=From:To:Subject:Date:From; b=FyO5IROK9J32GgweGi8ls794/B4A1ZnmrmEM5DcRy/n9R1JQW8BIaHoKXDhMpdn+0 Eqtki/6RlQF/kwJpgNrtcBYzpFJrvrEmY2EpTHBU/oWVLCfhhhkgw0jJ95bbr/duR+ vhmCrMrJ01rwffs4Sk9DinTIfIywHJF5tVwxPP34= From: "jo.hiller+gcc at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/110805] New: g++ crash on modules with exported class providing string constant with obscure content Date: Tue, 25 Jul 2023 16:27:19 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 13.1.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jo.hiller+gcc at gmail dot com X-Bugzilla-Status: UNCONFIRMED 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone attachments.created Message-ID: 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=3D110805 Bug ID: 110805 Summary: g++ crash on modules with exported class providing string constant with obscure content Product: gcc Version: 13.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: jo.hiller+gcc at gmail dot com Target Milestone: --- Created attachment 55630 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D55630&action=3Dedit output of -freport-bug // Info gcc-13 --version gcc-13 (Homebrew GCC 13.1.0) 13.1.0 macOS 13.5, arm64, Apple M1 MAX // Steps to reproduce * use a C++20 module with exported class providing obscure string constant * gcc 13.1 crash with "m.cc:3:8: internal compiler error: Segmentation faul= t: 11" // m.cc module; #include export module m; export class Constants { public: inline static const std::string CONST_CRASH_1 =3D "Bundle-Activator"; }; // build gcc-13 -freport-bug -std=3Dc++20 -xc++ -fmodules-ts -fmodule-only -Wall -We= xtra m.cc # see attached output file ccRJ91Vu.out // notes * exported string constants outside exported class do work * string constants with different types/values do work as well, see differe= nt string value, very obscure static constexpr std::string_view CONST_OK_1 =3D "Bundle-Activator"; inline static const std::string CONST_OK_2 =3D "bundleactivator"; inline static const std::string CONST_OK_3 =3D "Bundle-Activato"; inline static const std::string CONST_OK_4 =3D "undle-Activator"; inline static const std::string CONST_OK_5 =3D "xxxXactivatorll"; * these string constants do fail as well inline static const std::string CONST_CRASH_2 =3D "xxxbundleXactivatorlll= "; inline static const std::string CONST_CRASH_3 =3D "xxxXactivatorlll"; inline static const std::string CONST_CRASH_4 =3D "xxxXactivatorlll"; * it seems this pattern ".*.activator.*" triggeres special handling in gcc-= 13, lower/upper case seems not to be relevant, but number of characters before/after=