public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/101914] New: internal compiler error: in tsubst, at cp/pt.c:15553
@ 2021-08-14 21:03 accounts at prantare dot xyz
  2021-08-16  8:04 ` [Bug c++/101914] " marxin at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: accounts at prantare dot xyz @ 2021-08-14 21:03 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101914

            Bug ID: 101914
           Summary: internal compiler error: in tsubst, at cp/pt.c:15553
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: accounts at prantare dot xyz
  Target Milestone: ---

The following (preprocessed) code

---
# 0 "main.cpp"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "main.cpp"
template<class>
struct A {
    int x;
};

template<class T>
A(T) -> A<T>;

template<auto v>
using B = decltype(A{v});

template<auto v>
auto x = A<B<v>>{};

int main()
{
    x<0>;
}
---

yields the following error message:

---
main.cpp: In instantiation of ‘auto x<0>’:
main.cpp:17:5:   required from here
main.cpp:13:6: internal compiler error: in tsubst, at cp/pt.c:15553
   13 | auto x = A<B<v>>{};
      |      ^
0x6eef60 tsubst(tree_node*, tree_node*, int, tree_node*)
        ../../gcc/gcc/cp/pt.c:15553
0xaeb4f4 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
        ../../gcc/gcc/cp/pt.c:20630
0xb08797 tsubst(tree_node*, tree_node*, int, tree_node*)
        ../../gcc/gcc/cp/pt.c:16094
0xb0b174 tsubst_template_args(tree_node*, tree_node*, int, tree_node*)
        ../../gcc/gcc/cp/pt.c:13355
0xb14683 tsubst_aggr_type
        ../../gcc/gcc/cp/pt.c:13559
0xaeb4f4 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
        ../../gcc/gcc/cp/pt.c:20630
0xaf62a7 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        ../../gcc/gcc/cp/pt.c:19094
0xafd231 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        ../../gcc/gcc/cp/pt.c:18108
0xafd231 tsubst_init
        ../../gcc/gcc/cp/pt.c:16452
0xafe252 regenerate_decl_from_template
        ../../gcc/gcc/cp/pt.c:25490
0xafe252 instantiate_body
        ../../gcc/gcc/cp/pt.c:25813
0xb001ea instantiate_decl(tree_node*, bool, bool)
        ../../gcc/gcc/cp/pt.c:26171
0x9e07aa maybe_instantiate_decl(tree_node*)
        ../../gcc/gcc/cp/decl2.c:5495
0x9e1739 maybe_instantiate_decl(tree_node*)
        ../../gcc/gcc/cp/decl2.c:5698
0x9e1739 mark_used(tree_node*, int)
        ../../gcc/gcc/cp/decl2.c:5724
0xb3f7b8 finish_id_expression_1
        ../../gcc/gcc/cp/semantics.c:4132
0xb3fbb7 finish_id_expression(tree_node*, tree_node*, tree_node*, cp_id_kind*,
bool, bool, bool*, bool, bool, bool, bool, char const**, unsigned int)
        ../../gcc/gcc/cp/semantics.c:4261
0xa9e152 cp_parser_primary_expression
        ../../gcc/gcc/cp/parser.c:6008
0xaa0aed cp_parser_postfix_expression
        ../../gcc/gcc/cp/parser.c:7566
0xa8a1aa cp_parser_binary_expression
        ../../gcc/gcc/cp/parser.c:9896
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
---

The command that triggers the bug: g++ main.cpp -std=c++20

Version et.c.:

---
$ g++ -v:

Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/x86_64-pc-linux-gnu/12.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --disable-multilib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 12.0.0 20210813 (experimental) (GCC)
---

The bug appears in 11.1.0 too, on two different machines.
It compiles successfully with clang 14.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug c++/101914] internal compiler error: in tsubst, at cp/pt.c:15553
  2021-08-14 21:03 [Bug c++/101914] New: internal compiler error: in tsubst, at cp/pt.c:15553 accounts at prantare dot xyz
@ 2021-08-16  8:04 ` marxin at gcc dot gnu.org
  2021-10-01 10:16 ` pinskia at gcc dot gnu.org
  2022-03-29 17:54 ` ppalka at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-08-16  8:04 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101914

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jason at gcc dot gnu.org,
                   |                            |marxin at gcc dot gnu.org
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2021-08-16
     Ever confirmed|0                           |1
           Keywords|                            |ice-on-valid-code

--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
Confirmed.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug c++/101914] internal compiler error: in tsubst, at cp/pt.c:15553
  2021-08-14 21:03 [Bug c++/101914] New: internal compiler error: in tsubst, at cp/pt.c:15553 accounts at prantare dot xyz
  2021-08-16  8:04 ` [Bug c++/101914] " marxin at gcc dot gnu.org
@ 2021-10-01 10:16 ` pinskia at gcc dot gnu.org
  2022-03-29 17:54 ` ppalka at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-10-01 10:16 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101914

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
GCC 6 rejected the code.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug c++/101914] internal compiler error: in tsubst, at cp/pt.c:15553
  2021-08-14 21:03 [Bug c++/101914] New: internal compiler error: in tsubst, at cp/pt.c:15553 accounts at prantare dot xyz
  2021-08-16  8:04 ` [Bug c++/101914] " marxin at gcc dot gnu.org
  2021-10-01 10:16 ` pinskia at gcc dot gnu.org
@ 2022-03-29 17:54 ` ppalka at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: ppalka at gcc dot gnu.org @ 2022-03-29 17:54 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101914

Patrick Palka <ppalka at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ppalka at gcc dot gnu.org
         Resolution|---                         |DUPLICATE
             Status|NEW                         |RESOLVED

--- Comment #3 from Patrick Palka <ppalka at gcc dot gnu.org> ---
This appears to be a dup of PR91911, which has recently been fixed for GCC 12.

*** This bug has been marked as a duplicate of bug 91911 ***

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-03-29 17:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-14 21:03 [Bug c++/101914] New: internal compiler error: in tsubst, at cp/pt.c:15553 accounts at prantare dot xyz
2021-08-16  8:04 ` [Bug c++/101914] " marxin at gcc dot gnu.org
2021-10-01 10:16 ` pinskia at gcc dot gnu.org
2022-03-29 17:54 ` 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).