public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/115195] New: [12 Regression] Segfault when instantiating template
@ 2024-05-22 19:06 patrick at rivosinc dot com
  2024-05-22 19:12 ` [Bug c++/115195] " pinskia at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: patrick at rivosinc dot com @ 2024-05-22 19:06 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 115195
           Summary: [12 Regression] Segfault when instantiating template
           Product: gcc
           Version: 12.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: patrick at rivosinc dot com
  Target Milestone: ---

Testcase:
enum a { b };
using c = int;
template <typename d> void e(int, int, int, c *, d, int) {
  [](auto) {
    [] {
      struct {
      } f;
    };
  };
}
int g, h;
a i() {
  return b;
  e({}, {}, g, &h, [] {}, {});
}

Backtrace (from godbolt since it's more verbose than my local backtrace):
> g++-12 reduced.cc
<source>: In instantiation of 'void e(int, int, int, c*, d, int) [with d =
i()::<lambda()>; c = int]':
<source>:14:4:   required from here
<source>:5:5: internal compiler error: Segmentation fault
    5 |     [] {
      |     ^
0x1bbabfe internal_error(char const*, ...)
        ???:0
0x10b0223 walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*,
tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*))
        ???:0
0x10b0516 walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*,
tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*))
        ???:0
0x10b0223 walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*,
tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*))
        ???:0
0x870a79 check_for_bare_parameter_packs(tree_node*, unsigned int)
        ???:0
0x8a7dfb finish_expr_stmt(tree_node*)
        ???:0
0x891a08 tsubst_lambda_expr(tree_node*, tree_node*, int, tree_node*)
        ???:0
0x87e337 instantiate_decl(tree_node*, bool, bool)
        ???:0
0x899e8b instantiate_pending_templates(int)
        ???:0
0x7a5298 c_parse_final_cleanups()
        ???:0
Please submit a full bug report, with preprocessed source.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

Godbolt: https://godbolt.org/z/dda478Po6

Only on GCC 12.

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

* [Bug c++/115195] [12 Regression] Segfault when instantiating template
  2024-05-22 19:06 [Bug c++/115195] New: [12 Regression] Segfault when instantiating template patrick at rivosinc dot com
@ 2024-05-22 19:12 ` pinskia at gcc dot gnu.org
  2024-05-22 19:13 ` pinskia at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-05-22 19:12 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
I think this is a dup of bug 114303.

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

* [Bug c++/115195] [12 Regression] Segfault when instantiating template
  2024-05-22 19:06 [Bug c++/115195] New: [12 Regression] Segfault when instantiating template patrick at rivosinc dot com
  2024-05-22 19:12 ` [Bug c++/115195] " pinskia at gcc dot gnu.org
@ 2024-05-22 19:13 ` pinskia at gcc dot gnu.org
  2024-05-22 19:14 ` pinskia at gcc dot gnu.org
  2024-05-22 19:46 ` patrick at rivosinc dot com
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-05-22 19:13 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |DUPLICATE

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Dup of bug 109241.

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

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

* [Bug c++/115195] [12 Regression] Segfault when instantiating template
  2024-05-22 19:06 [Bug c++/115195] New: [12 Regression] Segfault when instantiating template patrick at rivosinc dot com
  2024-05-22 19:12 ` [Bug c++/115195] " pinskia at gcc dot gnu.org
  2024-05-22 19:13 ` pinskia at gcc dot gnu.org
@ 2024-05-22 19:14 ` pinskia at gcc dot gnu.org
  2024-05-22 19:46 ` patrick at rivosinc dot com
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-05-22 19:14 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109241#c5 is a reduced version of
comment #0 here.

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

* [Bug c++/115195] [12 Regression] Segfault when instantiating template
  2024-05-22 19:06 [Bug c++/115195] New: [12 Regression] Segfault when instantiating template patrick at rivosinc dot com
                   ` (2 preceding siblings ...)
  2024-05-22 19:14 ` pinskia at gcc dot gnu.org
@ 2024-05-22 19:46 ` patrick at rivosinc dot com
  3 siblings, 0 replies; 5+ messages in thread
From: patrick at rivosinc dot com @ 2024-05-22 19:46 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Patrick O'Neill <patrick at rivosinc dot com> ---
Thanks Andrew

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

end of thread, other threads:[~2024-05-22 19:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-22 19:06 [Bug c++/115195] New: [12 Regression] Segfault when instantiating template patrick at rivosinc dot com
2024-05-22 19:12 ` [Bug c++/115195] " pinskia at gcc dot gnu.org
2024-05-22 19:13 ` pinskia at gcc dot gnu.org
2024-05-22 19:14 ` pinskia at gcc dot gnu.org
2024-05-22 19:46 ` patrick at rivosinc dot com

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