public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/98881] New: [modules] internal compiler error: in tpl_parms_fini, at cp/module.cc:9933
@ 2021-01-29 10:17 pilarlatiesa at gmail dot com
2021-01-29 12:17 ` [Bug c++/98881] " marxin at gcc dot gnu.org
` (8 more replies)
0 siblings, 9 replies; 10+ messages in thread
From: pilarlatiesa at gmail dot com @ 2021-01-29 10:17 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98881
Bug ID: 98881
Summary: [modules] internal compiler error: in tpl_parms_fini,
at cp/module.cc:9933
Product: gcc
Version: 11.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: pilarlatiesa at gmail dot com
Target Milestone: ---
$ /home/pililatiesa/GCC-11/bin/g++ -v
Using built-in specs.
COLLECT_GCC=/home/pililatiesa/GCC-11/bin/g++
COLLECT_LTO_WRAPPER=/home/pililatiesa/GCC-11/bin/../libexec/gcc/x86_64-pc-linux-gnu/11.0.0/lto-wrapper.exe
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-master/configure --prefix=/home/pililatiesa/GCC-11
--enable-languages=c++ --disable-bootstrap
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 11.0.0 20210129 (experimental) (GCC)
$ cat Expresion.ixx
export module Expr;
template <int, int, typename, typename>
class TExprSistema;
template <typename T>
class TExprBase {};
export
template<int d, int r1, typename... TRest,
template <int, int, typename...> typename T>
class TExprBase<T<d, r1, TRest...>>
{
public:
template<typename... URest, template <int, int, typename...> typename U>
TExprSistema<d, r1, T<d, r1, TRest...>, U<d, r1, URest...>>
inline operator ==(TExprBase<U<d, r1, URest...>> const &rhs) const noexcept
{ return {*this, rhs}; }
};
export
template<int d, int r, typename T, typename U>
class TExprSistema: public TExprBase<TExprSistema<d, r, T, U>>
{
private:
TExprBase<T> const &lhs;
TExprBase<U> const &rhs;
public:
inline TExprSistema(TExprBase<T> const &lhs_, TExprBase<U> const &rhs_)
noexcept :
lhs(lhs_), rhs(rhs_) {}
};
$ /home/pililatiesa/GCC-11/bin/g++ -fmodules-ts -x c++ -std=c++20 Expresion.ixx
-o foo
Expresion.ixx:2:8: internal compiler error: in tpl_parms_fini, at
cp/module.cc:9933
2 | export module Expr;
| ^~~~~~
Expresion.ixx:2:8: internal compiler error: Aborted
g++: internal compiler error: Aborted signal terminated program cc1plus
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://gcc.gnu.org/bugs/> for instructions.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/98881] [modules] internal compiler error: in tpl_parms_fini, at cp/module.cc:9933
2021-01-29 10:17 [Bug c++/98881] New: [modules] internal compiler error: in tpl_parms_fini, at cp/module.cc:9933 pilarlatiesa at gmail dot com
@ 2021-01-29 12:17 ` marxin at gcc dot gnu.org
2021-01-29 13:05 ` nathan at gcc dot gnu.org
` (7 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-01-29 12:17 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98881
Martin Liška <marxin at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever confirmed|0 |1
CC| |marxin at gcc dot gnu.org
Last reconfirmed| |2021-01-29
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/98881] [modules] internal compiler error: in tpl_parms_fini, at cp/module.cc:9933
2021-01-29 10:17 [Bug c++/98881] New: [modules] internal compiler error: in tpl_parms_fini, at cp/module.cc:9933 pilarlatiesa at gmail dot com
2021-01-29 12:17 ` [Bug c++/98881] " marxin at gcc dot gnu.org
@ 2021-01-29 13:05 ` nathan at gcc dot gnu.org
2021-01-29 19:36 ` nathan at gcc dot gnu.org
` (6 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: nathan at gcc dot gnu.org @ 2021-01-29 13:05 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98881
Nathan Sidwell <nathan at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Assignee|unassigned at gcc dot gnu.org |nathan at gcc dot gnu.org
Status|NEW |ASSIGNED
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/98881] [modules] internal compiler error: in tpl_parms_fini, at cp/module.cc:9933
2021-01-29 10:17 [Bug c++/98881] New: [modules] internal compiler error: in tpl_parms_fini, at cp/module.cc:9933 pilarlatiesa at gmail dot com
2021-01-29 12:17 ` [Bug c++/98881] " marxin at gcc dot gnu.org
2021-01-29 13:05 ` nathan at gcc dot gnu.org
@ 2021-01-29 19:36 ` nathan at gcc dot gnu.org
2021-02-03 14:50 ` nathan at gcc dot gnu.org
` (5 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: nathan at gcc dot gnu.org @ 2021-01-29 19:36 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98881
--- Comment #1 from Nathan Sidwell <nathan at gcc dot gnu.org> ---
Reduced testcase:
export module Expr;
template <typename T> class TBase {};
template<template <typename> typename TTpl>
class TBase<TTpl<int>>
{
public:
template<template <typename> typename UTpl>
void Foo (TBase<UTpl<int>> &rhs);
};
void Frob (TBase<int>&);
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/98881] [modules] internal compiler error: in tpl_parms_fini, at cp/module.cc:9933
2021-01-29 10:17 [Bug c++/98881] New: [modules] internal compiler error: in tpl_parms_fini, at cp/module.cc:9933 pilarlatiesa at gmail dot com
` (2 preceding siblings ...)
2021-01-29 19:36 ` nathan at gcc dot gnu.org
@ 2021-02-03 14:50 ` nathan at gcc dot gnu.org
2021-02-15 10:48 ` pilarlatiesa at gmail dot com
` (4 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: nathan at gcc dot gnu.org @ 2021-02-03 14:50 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98881
--- Comment #2 from Nathan Sidwell <nathan at gcc dot gnu.org> ---
Created attachment 50120
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50120&action=edit
reduced testcase
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/98881] [modules] internal compiler error: in tpl_parms_fini, at cp/module.cc:9933
2021-01-29 10:17 [Bug c++/98881] New: [modules] internal compiler error: in tpl_parms_fini, at cp/module.cc:9933 pilarlatiesa at gmail dot com
` (3 preceding siblings ...)
2021-02-03 14:50 ` nathan at gcc dot gnu.org
@ 2021-02-15 10:48 ` pilarlatiesa at gmail dot com
2022-05-27 8:58 ` pilarlatiesa at gmail dot com
` (3 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: pilarlatiesa at gmail dot com @ 2021-02-15 10:48 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98881
--- Comment #3 from Pilar Latiesa <pilarlatiesa at gmail dot com> ---
Including vector + any header from range-v3 also triggers the ICE.
For example (https://godbolt.org/z/qnMe45):
module;
#include <vector>
#include <range/v3/view/zip.hpp>
export module M;
void f()
{
std::vector<int> v;
};
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/98881] [modules] internal compiler error: in tpl_parms_fini, at cp/module.cc:9933
2021-01-29 10:17 [Bug c++/98881] New: [modules] internal compiler error: in tpl_parms_fini, at cp/module.cc:9933 pilarlatiesa at gmail dot com
` (4 preceding siblings ...)
2021-02-15 10:48 ` pilarlatiesa at gmail dot com
@ 2022-05-27 8:58 ` pilarlatiesa at gmail dot com
2024-03-05 16:39 ` pilarlatiesa at gmail dot com
` (2 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: pilarlatiesa at gmail dot com @ 2022-05-27 8:58 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98881
--- Comment #4 from Pilar Latiesa <pilarlatiesa at gmail dot com> ---
I can no longer reproduce the issue with 11.3 or 12.1
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/98881] [modules] internal compiler error: in tpl_parms_fini, at cp/module.cc:9933
2021-01-29 10:17 [Bug c++/98881] New: [modules] internal compiler error: in tpl_parms_fini, at cp/module.cc:9933 pilarlatiesa at gmail dot com
` (5 preceding siblings ...)
2022-05-27 8:58 ` pilarlatiesa at gmail dot com
@ 2024-03-05 16:39 ` pilarlatiesa at gmail dot com
2024-03-07 11:00 ` cvs-commit at gcc dot gnu.org
2024-03-07 11:01 ` nshead at gcc dot gnu.org
8 siblings, 0 replies; 10+ messages in thread
From: pilarlatiesa at gmail dot com @ 2024-03-05 16:39 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98881
--- Comment #5 from Pilar Latiesa <pilarlatiesa at gmail dot com> ---
(In reply to Pilar Latiesa from comment #4)
> I can no longer reproduce the issue with 11.3 or 12.1
Because those were releases that didn't have checking enabled.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/98881] [modules] internal compiler error: in tpl_parms_fini, at cp/module.cc:9933
2021-01-29 10:17 [Bug c++/98881] New: [modules] internal compiler error: in tpl_parms_fini, at cp/module.cc:9933 pilarlatiesa at gmail dot com
` (6 preceding siblings ...)
2024-03-05 16:39 ` pilarlatiesa at gmail dot com
@ 2024-03-07 11:00 ` cvs-commit at gcc dot gnu.org
2024-03-07 11:01 ` nshead at gcc dot gnu.org
8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-03-07 11:00 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98881
--- Comment #6 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Nathaniel Shead <nshead@gcc.gnu.org>:
https://gcc.gnu.org/g:77772f8a3da8ea30066d2201f8148714a8e89da5
commit r14-9356-g77772f8a3da8ea30066d2201f8148714a8e89da5
Author: Nathaniel Shead <nathanieloshead@gmail.com>
Date: Tue Mar 5 15:17:09 2024 +1100
c++: Stream DECL_CONTEXT for template template parms [PR98881]
When streaming in a nested template-template parameter as in the
attached testcase, we end up reaching the containing template-template
parameter in 'tpl_parms_fini'. We should not set the DECL_CONTEXT to
this (nested) template-template parameter, as it should already be the
struct that the outer template-template parameter is declared on.
The precise logic for what DECL_CONTEXT should be for a template
template parameter in various situations seems rather obscure. Rather
than trying to determine the assumptions that need to hold, it seems
simpler to just always re-stream the DECL_CONTEXT as needed for now.
PR c++/98881
gcc/cp/ChangeLog:
* module.cc (trees_out::tpl_parms_fini): Stream out DECL_CONTEXT
for template template parameters.
(trees_in::tpl_parms_fini): Read it.
gcc/testsuite/ChangeLog:
* g++.dg/modules/tpl-tpl-parm-3.h: New test.
* g++.dg/modules/tpl-tpl-parm-3_a.H: New test.
* g++.dg/modules/tpl-tpl-parm-3_b.C: New test.
* g++.dg/modules/tpl-tpl-parm-3_c.C: New test.
Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com>
Reviewed-by: Patrick Palka <ppalka@redhat.com>
Reviewed-by: Jason Merrill <jason@redhat.com>
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/98881] [modules] internal compiler error: in tpl_parms_fini, at cp/module.cc:9933
2021-01-29 10:17 [Bug c++/98881] New: [modules] internal compiler error: in tpl_parms_fini, at cp/module.cc:9933 pilarlatiesa at gmail dot com
` (7 preceding siblings ...)
2024-03-07 11:00 ` cvs-commit at gcc dot gnu.org
@ 2024-03-07 11:01 ` nshead at gcc dot gnu.org
8 siblings, 0 replies; 10+ messages in thread
From: nshead at gcc dot gnu.org @ 2024-03-07 11:01 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98881
Nathaniel Shead <nshead at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |FIXED
CC| |nshead at gcc dot gnu.org
Assignee|nathan at gcc dot gnu.org |nshead at gcc dot gnu.org
Target Milestone|--- |14.0
Status|ASSIGNED |RESOLVED
--- Comment #7 from Nathaniel Shead <nshead at gcc dot gnu.org> ---
Fixed for GCC 14.
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2024-03-07 11:01 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-29 10:17 [Bug c++/98881] New: [modules] internal compiler error: in tpl_parms_fini, at cp/module.cc:9933 pilarlatiesa at gmail dot com
2021-01-29 12:17 ` [Bug c++/98881] " marxin at gcc dot gnu.org
2021-01-29 13:05 ` nathan at gcc dot gnu.org
2021-01-29 19:36 ` nathan at gcc dot gnu.org
2021-02-03 14:50 ` nathan at gcc dot gnu.org
2021-02-15 10:48 ` pilarlatiesa at gmail dot com
2022-05-27 8:58 ` pilarlatiesa at gmail dot com
2024-03-05 16:39 ` pilarlatiesa at gmail dot com
2024-03-07 11:00 ` cvs-commit at gcc dot gnu.org
2024-03-07 11:01 ` nshead at gcc dot gnu.org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).