public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/98611] New: [concepts] internal compiler error: in get_underlying_template, at cp/pt.c:6494
@ 2021-01-09 9:34 bjornsundin02 at gmail dot com
2021-01-09 17:12 ` [Bug c++/98611] " ppalka at gcc dot gnu.org
` (7 more replies)
0 siblings, 8 replies; 9+ messages in thread
From: bjornsundin02 at gmail dot com @ 2021-01-09 9:34 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98611
Bug ID: 98611
Summary: [concepts] internal compiler error: in
get_underlying_template, at cp/pt.c:6494
Product: gcc
Version: 10.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: bjornsundin02 at gmail dot com
Target Milestone: ---
Created attachment 49924
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49924&action=edit
Preprocessed minimal C++20 code that crashes the compiler
I created a 23 lines long piece of code that uses C++20 concepts with no
includes that crashes the compiler. Below is the full output of the command
"gcc -v -save-temps -std=c++20 minimal.cpp". I did however try this on
godbolt.org, both with trunk and 10.2.0 versions and it crashed the compiler as
well, so most of this information is probably not needed anyways. Compiler
explorer link: https://godbolt.org/z/eqdzoc
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=c:/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/10.2.0/lto-wrapper.exe
Target: x86_64-w64-mingw32
Configured with: ../configure
--prefix=/d/Prog/winlibs64-10.2.0/home/inst_gcc-10.2.0/share/gcc
--build=x86_64-w64-mingw32 --host=x86_64-w64-mingw32
--with-pkgversion='MinGW-W64 x86_64-posix-seh, built by Brecht Sanders'
--with-tune=generic --enable-checking=release --enable-threads=posix
--disable-sjlj-exceptions --disable-libunwind-exceptions
--enable-serial-configure --disable-bootstrap --enable-host-shared
--enable-plugin --enable-default-ssp --disable-rpath --disable-libstdcxx-pch
--enable-libstdcxx-time=yes --disable-libstdcxx-debug
--disable-version-specific-runtime-libs --with-stabs --disable-symvers
--enable-languages=c,c++,fortran,lto,objc,obj-c++,d --disable-gold
--disable-nls --disable-stage1-checking --disable-win32-registry
--disable-multilib --enable-ld --enable-libquadmath --enable-libada
--enable-libssp --enable-libstdcxx --enable-lto --enable-fully-dynamic-string
--enable-libgomp --enable-graphite --enable-mingw-wildcard
--with-mpc=/d/Prog/winlibs64-10.2.0/custombuilt
--with-mpfr=/d/Prog/winlibs64-10.2.0/custombuilt
--with-gmp=/d/Prog/winlibs64-10.2.0/custombuilt
--with-isl=/d/Prog/winlibs64-10.2.0/custombuilt --enable-install-libiberty
--enable-__cxa_atexit --without-included-gettext --with-diagnostics-color=auto
--with-libiconv --with-system-zlib
--with-build-sysroot=/d/Prog/winlibs64-10.2.0/home/gcc-10.2.0/build_mingw/mingw-w64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 10.2.0 (MinGW-W64 x86_64-posix-seh, built by Brecht Sanders)
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-std=c++2a' '-mtune=generic'
'-march=x86-64'
c:/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/10.2.0/cc1plus.exe -E -quiet
-v -iprefix c:\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/10.2.0/ -D_REENTRANT
minimal.cpp -mtune=generic -march=x86-64 -std=c++2a -fpch-preprocess -o
minimal.ii
ignoring duplicate directory
"c:/mingw64/lib/gcc/../../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../include/c++/10.2.0"
ignoring duplicate directory
"c:/mingw64/lib/gcc/../../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../include/c++/10.2.0/x86_64-w64-mingw32"
ignoring duplicate directory
"c:/mingw64/lib/gcc/../../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../include/c++/10.2.0/backward"
ignoring duplicate directory
"c:/mingw64/lib/gcc/../../lib/gcc/x86_64-w64-mingw32/10.2.0/include"
ignoring nonexistent directory
"D:/Prog/winlibs64-10.2.0/home/inst_gcc-10.2.0/share/gcc/include"
ignoring nonexistent directory
"/d/Prog/winlibs64-10.2.0/home/inst_gcc-10.2.0/share/gcc/include"
ignoring duplicate directory
"c:/mingw64/lib/gcc/../../lib/gcc/x86_64-w64-mingw32/10.2.0/include-fixed"
ignoring duplicate directory
"c:/mingw64/lib/gcc/../../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/include"
ignoring nonexistent directory "/mingw/include"
#include "..." search starts here:
#include <...> search starts here:
c:\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../include/c++/10.2.0
c:\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../include/c++/10.2.0/x86_64-w64-mingw32
c:\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../include/c++/10.2.0/backward
c:\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/10.2.0/include
c:\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../include
c:\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/10.2.0/include-fixed
c:\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/include
End of search list.
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-std=c++2a' '-mtune=generic'
'-march=x86-64'
c:/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/10.2.0/cc1plus.exe
-fpreprocessed minimal.ii -quiet -dumpbase minimal.cpp -mtune=generic
-march=x86-64 -auxbase minimal -std=c++2a -version -o minimal.s
GNU C++17 (MinGW-W64 x86_64-posix-seh, built by Brecht Sanders) version 10.2.0
(x86_64-w64-mingw32)
compiled by GNU C version 10.2.0, GMP version 6.2.0, MPFR version
4.0.2, MPC version 1.1.0, isl version isl-0.22.1-GMP
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
GNU C++17 (MinGW-W64 x86_64-posix-seh, built by Brecht Sanders) version 10.2.0
(x86_64-w64-mingw32)
compiled by GNU C version 10.2.0, GMP version 6.2.0, MPFR version
4.0.2, MPC version 1.1.0, isl version isl-0.22.1-GMP
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 0faeb1ddadd8f43fea33747988e615bd
minimal.cpp: In function 'int main()':
minimal.cpp:15:4: internal compiler error: in get_underlying_template, at
cp/pt.c:6494
15 | { _Class{object} } -> IsSame<T>;
| ~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
libbacktrace could not find executable to open
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://gcc.gnu.org/bugs/> for instructions.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/98611] [concepts] internal compiler error: in get_underlying_template, at cp/pt.c:6494
2021-01-09 9:34 [Bug c++/98611] New: [concepts] internal compiler error: in get_underlying_template, at cp/pt.c:6494 bjornsundin02 at gmail dot com
@ 2021-01-09 17:12 ` ppalka at gcc dot gnu.org
2021-01-11 8:17 ` [Bug c++/98611] [concepts] ICE in get_underlying_template, at cp/pt.c:6494 since r10-3735-gcb57504a55015891 marxin at gcc dot gnu.org
` (6 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: ppalka at gcc dot gnu.org @ 2021-01-09 17:12 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98611
Patrick Palka <ppalka at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |ppalka at gcc dot gnu.org
Known to fail| |10.2.0, 11.0
Assignee|unassigned at gcc dot gnu.org |ppalka at gcc dot gnu.org
Ever confirmed|0 |1
Last reconfirmed| |2021-01-09
Target Milestone|--- |10.3
Status|UNCONFIRMED |ASSIGNED
--- Comment #1 from Patrick Palka <ppalka at gcc dot gnu.org> ---
Confirmed.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/98611] [concepts] ICE in get_underlying_template, at cp/pt.c:6494 since r10-3735-gcb57504a55015891
2021-01-09 9:34 [Bug c++/98611] New: [concepts] internal compiler error: in get_underlying_template, at cp/pt.c:6494 bjornsundin02 at gmail dot com
2021-01-09 17:12 ` [Bug c++/98611] " ppalka at gcc dot gnu.org
@ 2021-01-11 8:17 ` marxin at gcc dot gnu.org
2021-01-11 8:32 ` rguenth at gcc dot gnu.org
` (5 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-01-11 8:17 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98611
Martin Liška <marxin at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|[concepts] internal |[concepts] ICE in
|compiler error: in |get_underlying_template, at
|get_underlying_template, at |cp/pt.c:6494 since
|cp/pt.c:6494 |r10-3735-gcb57504a55015891
CC| |jason at gcc dot gnu.org,
| |marxin at gcc dot gnu.org
--- Comment #2 from Martin Liška <marxin at gcc dot gnu.org> ---
Started with r10-3735-gcb57504a55015891.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/98611] [concepts] ICE in get_underlying_template, at cp/pt.c:6494 since r10-3735-gcb57504a55015891
2021-01-09 9:34 [Bug c++/98611] New: [concepts] internal compiler error: in get_underlying_template, at cp/pt.c:6494 bjornsundin02 at gmail dot com
2021-01-09 17:12 ` [Bug c++/98611] " ppalka at gcc dot gnu.org
2021-01-11 8:17 ` [Bug c++/98611] [concepts] ICE in get_underlying_template, at cp/pt.c:6494 since r10-3735-gcb57504a55015891 marxin at gcc dot gnu.org
@ 2021-01-11 8:32 ` rguenth at gcc dot gnu.org
2021-01-11 8:37 ` [Bug c++/98611] [concepts][10/11 Regression] " marxin at gcc dot gnu.org
` (4 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-01-11 8:32 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98611
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |rguenth at gcc dot gnu.org
--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
Does GCC9 work?
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/98611] [concepts][10/11 Regression] ICE in get_underlying_template, at cp/pt.c:6494 since r10-3735-gcb57504a55015891
2021-01-09 9:34 [Bug c++/98611] New: [concepts] internal compiler error: in get_underlying_template, at cp/pt.c:6494 bjornsundin02 at gmail dot com
` (2 preceding siblings ...)
2021-01-11 8:32 ` rguenth at gcc dot gnu.org
@ 2021-01-11 8:37 ` marxin at gcc dot gnu.org
2021-01-12 14:35 ` cvs-commit at gcc dot gnu.org
` (3 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-01-11 8:37 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98611
Martin Liška <marxin at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|[concepts] ICE in |[concepts][10/11
|get_underlying_template, at |Regression] ICE in
|cp/pt.c:6494 since |get_underlying_template, at
|r10-3735-gcb57504a55015891 |cp/pt.c:6494 since
| |r10-3735-gcb57504a55015891
--- Comment #4 from Martin Liška <marxin at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #3)
> Does GCC9 work?
Yes.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/98611] [concepts][10/11 Regression] ICE in get_underlying_template, at cp/pt.c:6494 since r10-3735-gcb57504a55015891
2021-01-09 9:34 [Bug c++/98611] New: [concepts] internal compiler error: in get_underlying_template, at cp/pt.c:6494 bjornsundin02 at gmail dot com
` (3 preceding siblings ...)
2021-01-11 8:37 ` [Bug c++/98611] [concepts][10/11 Regression] " marxin at gcc dot gnu.org
@ 2021-01-12 14:35 ` cvs-commit at gcc dot gnu.org
2021-01-13 8:18 ` bjornsundin02 at gmail dot com
` (2 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-01-12 14:35 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98611
--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Patrick Palka <ppalka@gcc.gnu.org>:
https://gcc.gnu.org/g:e0bec6ceac47752616dd9fe0801344ed45db2fd3
commit r11-6614-ge0bec6ceac47752616dd9fe0801344ed45db2fd3
Author: Patrick Palka <ppalka@redhat.com>
Date: Tue Jan 12 09:34:41 2021 -0500
c++: Fix ICE with CTAD in concept [PR98611]
This patch teaches cp_walk_subtrees to visit the template represented
by a CTAD placeholder, which would otherwise be not visited during
find_template_parameters. The template may be a template template
parameter (as in the first testcase), or it may implicitly use the
template parameters of an enclosing class template (as in the second
testcase), and in either case we need to visit this tree to record the
template parameters used therein for later satisfaction.
gcc/cp/ChangeLog:
PR c++/98611
* tree.c (cp_walk_subtrees) <case TEMPLATE_TYPE_PARM>: Visit
the template of a CTAD placeholder.
gcc/testsuite/ChangeLog:
PR c++/98611
* g++.dg/cpp2a/concepts-ctad1.C: New test.
* g++.dg/cpp2a/concepts-ctad2.C: New test.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/98611] [concepts][10/11 Regression] ICE in get_underlying_template, at cp/pt.c:6494 since r10-3735-gcb57504a55015891
2021-01-09 9:34 [Bug c++/98611] New: [concepts] internal compiler error: in get_underlying_template, at cp/pt.c:6494 bjornsundin02 at gmail dot com
` (4 preceding siblings ...)
2021-01-12 14:35 ` cvs-commit at gcc dot gnu.org
@ 2021-01-13 8:18 ` bjornsundin02 at gmail dot com
2021-03-31 12:33 ` [Bug c++/98611] [concepts][10 " cvs-commit at gcc dot gnu.org
2021-03-31 12:36 ` ppalka at gcc dot gnu.org
7 siblings, 0 replies; 9+ messages in thread
From: bjornsundin02 at gmail dot com @ 2021-01-13 8:18 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98611
--- Comment #6 from Björn Sundin <bjornsundin02 at gmail dot com> ---
(In reply to CVS Commits from comment #5)
> The master branch has been updated by Patrick Palka <ppalka@gcc.gnu.org>:
>
> https://gcc.gnu.org/g:e0bec6ceac47752616dd9fe0801344ed45db2fd3
>
> commit r11-6614-ge0bec6ceac47752616dd9fe0801344ed45db2fd3
> Author: Patrick Palka <ppalka@redhat.com>
> Date: Tue Jan 12 09:34:41 2021 -0500
>
> c++: Fix ICE with CTAD in concept [PR98611]
>
> This patch teaches cp_walk_subtrees to visit the template represented
> by a CTAD placeholder, which would otherwise be not visited during
> find_template_parameters. The template may be a template template
> parameter (as in the first testcase), or it may implicitly use the
> template parameters of an enclosing class template (as in the second
> testcase), and in either case we need to visit this tree to record the
> template parameters used therein for later satisfaction.
>
> gcc/cp/ChangeLog:
>
> PR c++/98611
> * tree.c (cp_walk_subtrees) <case TEMPLATE_TYPE_PARM>: Visit
> the template of a CTAD placeholder.
>
> gcc/testsuite/ChangeLog:
>
> PR c++/98611
> * g++.dg/cpp2a/concepts-ctad1.C: New test.
> * g++.dg/cpp2a/concepts-ctad2.C: New test.
Brilliant! Appreciate you :). IsInstantiationOf is a very useful generic
concept that I'd love to be able to use in my project, so I'm happy this was
fixed.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/98611] [concepts][10 Regression] ICE in get_underlying_template, at cp/pt.c:6494 since r10-3735-gcb57504a55015891
2021-01-09 9:34 [Bug c++/98611] New: [concepts] internal compiler error: in get_underlying_template, at cp/pt.c:6494 bjornsundin02 at gmail dot com
` (5 preceding siblings ...)
2021-01-13 8:18 ` bjornsundin02 at gmail dot com
@ 2021-03-31 12:33 ` cvs-commit at gcc dot gnu.org
2021-03-31 12:36 ` ppalka at gcc dot gnu.org
7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-03-31 12:33 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98611
--- Comment #7 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Patrick Palka
<ppalka@gcc.gnu.org>:
https://gcc.gnu.org/g:57b0df85b7e4b50198a8d3a09d57c52f0d994ba8
commit r10-9635-g57b0df85b7e4b50198a8d3a09d57c52f0d994ba8
Author: Patrick Palka <ppalka@redhat.com>
Date: Tue Jan 12 09:34:41 2021 -0500
c++: Fix ICE with CTAD in concept [PR98611]
This patch teaches cp_walk_subtrees to visit the template represented
by a CTAD placeholder, which would otherwise be not visited during
find_template_parameters. The template may be a template template
parameter (as in the first testcase), or it may implicitly use the
template parameters of an enclosing class template (as in the second
testcase), and in either case we need to visit this tree to record the
template parameters used therein for later satisfaction.
gcc/cp/ChangeLog:
PR c++/98611
* tree.c (cp_walk_subtrees) <case TEMPLATE_TYPE_PARM>: Visit
the template of a CTAD placeholder.
gcc/testsuite/ChangeLog:
PR c++/98611
* g++.dg/cpp2a/concepts-ctad1.C: New test.
* g++.dg/cpp2a/concepts-ctad2.C: New test.
(cherry picked from commit e0bec6ceac47752616dd9fe0801344ed45db2fd3)
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/98611] [concepts][10 Regression] ICE in get_underlying_template, at cp/pt.c:6494 since r10-3735-gcb57504a55015891
2021-01-09 9:34 [Bug c++/98611] New: [concepts] internal compiler error: in get_underlying_template, at cp/pt.c:6494 bjornsundin02 at gmail dot com
` (6 preceding siblings ...)
2021-03-31 12:33 ` [Bug c++/98611] [concepts][10 " cvs-commit at gcc dot gnu.org
@ 2021-03-31 12:36 ` ppalka at gcc dot gnu.org
7 siblings, 0 replies; 9+ messages in thread
From: ppalka at gcc dot gnu.org @ 2021-03-31 12:36 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98611
Patrick Palka <ppalka at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |FIXED
Status|ASSIGNED |RESOLVED
--- Comment #8 from Patrick Palka <ppalka at gcc dot gnu.org> ---
Fixed.
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2021-03-31 12:36 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-09 9:34 [Bug c++/98611] New: [concepts] internal compiler error: in get_underlying_template, at cp/pt.c:6494 bjornsundin02 at gmail dot com
2021-01-09 17:12 ` [Bug c++/98611] " ppalka at gcc dot gnu.org
2021-01-11 8:17 ` [Bug c++/98611] [concepts] ICE in get_underlying_template, at cp/pt.c:6494 since r10-3735-gcb57504a55015891 marxin at gcc dot gnu.org
2021-01-11 8:32 ` rguenth at gcc dot gnu.org
2021-01-11 8:37 ` [Bug c++/98611] [concepts][10/11 Regression] " marxin at gcc dot gnu.org
2021-01-12 14:35 ` cvs-commit at gcc dot gnu.org
2021-01-13 8:18 ` bjornsundin02 at gmail dot com
2021-03-31 12:33 ` [Bug c++/98611] [concepts][10 " cvs-commit at gcc dot gnu.org
2021-03-31 12:36 ` ppalka 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).