From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 98B413858D20; Tue, 7 May 2024 23:21:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 98B413858D20 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1715124101; bh=i52vWB5HBk9RfAi9bcmuNC/l6rCZI3aroxRGjEeakRs=; h=From:To:Subject:Date:In-Reply-To:References:From; b=pfaDq1nbiKTHAEkj8slvunW6tbpa/twDV8uFyBKK+TxyZD9ugoebhdacUxGr+pkYp 2zZX3jt7tQhmhhJnFRwPy7qI6h6DNj9EA+fLJmJB5LpkWSWF0J/1zTjqt28Fmd4K5I eKBrv8ZellNpucDbTsbj82MhYmqZdsyjX2R+wvZ4= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/114856] [14/15 regression][modules] ICE (segfault) Date: Tue, 07 May 2024 23:21:41 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: nshead at gcc dot gnu.org X-Bugzilla-Target-Milestone: 14.2 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=3D114856 --- Comment #4 from GCC Commits --- The releases/gcc-14 branch has been updated by Nathaniel Shead : https://gcc.gnu.org/g:61a095b05c244a6e0b1aec36ee1607def00654ab commit r14-10182-g61a095b05c244a6e0b1aec36ee1607def00654ab Author: Nathaniel Shead Date: Tue Apr 30 22:29:57 2024 +1000 c++/modules: Stream unmergeable temporaries by value again [PR114856] In r14-9266-g2823b4d96d9ec4 I gave all temporary vars a DECL_CONTEXT, including those at namespace or global scope, so that they could be properly merged across importers. However, not all of these temporary vars are actually supposed to be mergeable. For instance, in the attached testcase we have an unnamed temporary var used in the NSDMI of a class member, which cannot properly merged -- but it also doesn't need to be, as it'll be thrown away when the class type itself is merged anyway. This patch reverts the change made above and instead makes a weaker adjustment that only causes temporary vars with linkage have a DECL_CONTEXT to merge from. This way these unnamed, "unmergeable" temporaries are properly streamed by value again. PR c++/114856 gcc/cp/ChangeLog: * call.cc (make_temporary_var_for_ref_to_temp): Set context for temporaries with linkage. * init.cc (create_temporary_var): Revert to only set context when in a function decl. gcc/testsuite/ChangeLog: * g++.dg/modules/pr114856.h: New test. * g++.dg/modules/pr114856_a.H: New test. * g++.dg/modules/pr114856_b.C: New test. Signed-off-by: Nathaniel Shead Reviewed-by: Jason Merrill Reviewed-by: Patrick Palka (cherry picked from commit e60032b382364897a58e67994baac896bcd03327)=