public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "patrick at rivosinc dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/115195] New: [12 Regression] Segfault when instantiating template
Date: Wed, 22 May 2024 19:06:00 +0000	[thread overview]
Message-ID: <bug-115195-4@http.gcc.gnu.org/bugzilla/> (raw)

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.

             reply	other threads:[~2024-05-22 19:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-22 19:06 patrick at rivosinc dot com [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-115195-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).