[Bug c++/114856] [14/15 regression][modules] ICE (segfault)

2024-05-07 Thread nshead at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114856

Nathaniel Shead  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|NEW |RESOLVED

--- Comment #5 from Nathaniel Shead  ---
Fixed for GCC 14.2 and trunk.

[Bug c++/114856] [14/15 regression][modules] ICE (segfault)

2024-05-07 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114856

--- 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)

[Bug c++/114856] [14/15 regression][modules] ICE (segfault)

2024-05-07 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114856

--- Comment #3 from GCC Commits  ---
The master branch has been updated by Nathaniel Shead :

https://gcc.gnu.org/g:e60032b382364897a58e67994baac896bcd03327

commit r15-310-ge60032b382364897a58e67994baac896bcd03327
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 

[Bug c++/114856] [14/15 regression][modules] ICE (segfault)

2024-05-07 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114856

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|14.0|14.2

--- Comment #2 from Richard Biener  ---
GCC 14.1 is being released, retargeting bugs to GCC 14.2.

[Bug c++/114856] [14/15 regression][modules] ICE (segfault)

2024-04-26 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114856

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|--- |14.0