From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 6FEB83858C98; Fri, 17 Nov 2023 14:24:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6FEB83858C98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1700231042; bh=12263IEV2cp11NBsvDdljDEw1PmLBw5iwRVMkL+3p3s=; h=From:To:Subject:Date:From; b=NGkC89UsRma9bpt11wMG7pgTURGridrgWFCa0PbKUWAXf9SLmfb9jh6JyVysNJyFW UcJy1khNmIFo5l2nuAdKEBKkMBKhd7/yJIGgD/5bss/7i38XbpPEw9Lg9yRvSKxcID m3qH+kVG8cPvud7p2Z6/fNkR3Zhrde8uDJ8igg50= From: "nickbegg at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/112588] New: ICE in make_decl_rtl when returning str literal when string header imported in module Date: Fri, 17 Nov 2023 14:24:01 +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: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: nickbegg 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=3D112588 Bug ID: 112588 Summary: ICE in make_decl_rtl when returning str literal when string header imported in module Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: nickbegg at gmail dot com Target Milestone: --- Created attachment 56622 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D56622&action=3Dedit -freport-bug output /home/nick/gcc-trunk-debug-inst/include/c++/14.0.0/bits/allocator.h:191:39: internal compiler error: in make_decl_rtl, at varasm.cc:1442 191 | if (__builtin_mul_overflow(__n, sizeof(_Tp), &__n)) | ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~ Using when importing a module into a non-module TU, #including string in bo= th causes an ICE when returning a string literal in a function with std::string return type - //////////////////////// // modA.mpp (compiled as module): module; #include export module modA; /////////////////////// // main.cpp (compiled as regular TU):=20 #include import modA; std::string test_func() { return "foo"; } int main() { return 0; } /////////////////////// The ICE happens when compiling main.cpp. Removing the import from main.cpp, or returning std::string() from test_fun= c() stops the ICE.=20 GCC trunk (14) version, git rev ba3f5b8465ef7b278ea33ff94cd85b9638058635=