[Bug c++/117040] New: g++ crashed for __alignof and got internal compiler error: in poplevel, at cp/decl.cc:643

2024-10-08 Thread yihan4845 at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117040

Bug ID: 117040
   Summary: g++ crashed for __alignof and got internal compiler
error: in poplevel, at cp/decl.cc:643
   Product: gcc
   Version: 15.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: yihan4845 at gmail dot com
  Target Milestone: ---

The following illformed code crashes current gcc trunk. This code was generated
by a fuzzer.

Compiler Explorer: https://godbolt.org/z/E8hYfzraz

Code:

_Alignof(auto);
struct S {
int t;
};

Stack dump:

:3:9: internal compiler error: in poplevel, at cp/decl.cc:643
0x283dbf5 diagnostic_context::diagnostic_impl(rich_location*,
diagnostic_metadata const*, diagnostic_option_id, char const*, __va_list_tag
(*) [1], diagnostic_t)
???:0
0x28515d5 internal_error(char const*, ...)
???:0
0xa87f78 fancy_abort(char const*, int, char const*)
???:0
0xc9e5f0 end_template_decl()
???:0
0xc954ca c_parse_file()
???:0
0xded089 c_common_parse_file()
???:0
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See  for instructions.
Compiler returned: 1

[Bug c++/117042] New: internal compiler error: Segmentation fault in tsubst(tree_node*, tree_node*, int, tree_node*)

2024-10-08 Thread yihan4845 at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117042

Bug ID: 117042
   Summary: internal compiler error: Segmentation fault in
tsubst(tree_node*, tree_node*, int, tree_node*)
   Product: gcc
   Version: 15.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: yihan4845 at gmail dot com
  Target Milestone: ---

The following illformed code crashes current gcc trunk. This code was generated
by a fuzzer.

Compiler Explorer: https://godbolt.org/z/bvzxP455G

Code:

template 
struct Future {
  explicit Future(T v);
  template 
  auto call(F&& fn) -> decltype(v(T())) {}
  template 
  auto then(F&& fn) -> decltype(call(fn)) {}
};
Future f;

Stack dump:

0x283dbf5 diagnostic_context::diagnostic_impl(rich_location*,
diagnostic_metadata const*, diagnostic_option_id, char const*, __va_list_tag
(*) [1], diagnostic_t)
???:0
0x28515d5 internal_error(char const*, ...)
???:0
0xcd3068 tsubst(tree_node*, tree_node*, int, tree_node*)
???:0
0xcd276d tsubst(tree_node*, tree_node*, int, tree_node*)
???:0
0xcf5edc instantiate_class_template(tree_node*)
???:0
0xb4b9a9 start_decl_1(tree_node*, bool)
???:0
0xb6e5cf start_decl(cp_declarator const*, cp_decl_specifier_seq*, int,
tree_node*, tree_node*, tree_node**)
???:0
0xc954ca c_parse_file()
???:0
0xded089 c_common_parse_file()
???:0
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See  for instructions.
Compiler returned: 1

[Bug c++/117118] New: internal compiler error: Segmentation fault in c_lex_with_flags(tree_node**, unsigned int*, unsigned char*, int)

2024-10-13 Thread yihan4845 at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117118

Bug ID: 117118
   Summary: internal compiler error: Segmentation fault in
c_lex_with_flags(tree_node**, unsigned int*, unsigned
char*, int)
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: yihan4845 at gmail dot com
  Target Milestone: ---

Compiler Explorer: https://godbolt.org/z/nT16x49sE

The following program:
```cpp
#pragma message "" = R""
```

will trigger segmentation fault for gcc trunk.

The stack dump:
```
0x2867155 diagnostic_context::diagnostic_impl(rich_location*,
diagnostic_metadata const*, diagnostic_option_id, char const*, __va_list_tag
(*) [1], diagnostic_t)
???:0
0x287af35 internal_error(char const*, ...)
???:0
0x28fd642 _cpp_lex_direct
???:0
0x28ff4b0 _cpp_lex_token
???:0
0xdde522 c_lex_with_flags(tree_node**, unsigned int*, unsigned char*, int)
???:0
0xc9a0da c_parse_file()
???:0
0xdf1f69 c_common_parse_file()
???:0
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See  for instructions.
Compiler returned: 1
```

[Bug c++/117108] New: internal compiler error: error reporting routines re-entered at build_c_cast(unsigned int, tree_node*, cp_expr)

2024-10-12 Thread yihan4845 at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117108

Bug ID: 117108
   Summary: internal compiler error: error reporting routines
re-entered at build_c_cast(unsigned int, tree_node*,
cp_expr)
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: yihan4845 at gmail dot com
  Target Milestone: ---

Compiler Explorer: https://godbolt.org/z/G3rT9aaGW

The following program:
```cpp
typedef char __attribute__((aligned(2))) AlignedChar;
typedef AlignedChar arrayType0[4];
void test(char *p) {
  auto r0 = (AlignedChar(&)[1])(*p & 1); 
}
```

will trigger segmentation fault for gcc trunk.

The stack dump:
```
internal compiler error: error reporting routines re-entered.
0x285c0cf diagnostic_context::report_diagnostic(diagnostic_info*)
???:0
0x285c505 diagnostic_context::diagnostic_impl(rich_location*,
diagnostic_metadata const*, diagnostic_option_id, char const*, __va_list_tag
(*) [1], diagnostic_t)
???:0
0x286f955 error(char const*, ...)
???:0
0x28930d3 pretty_printer::format(text_info&)
???:0
0x285c222 diagnostic_context::report_diagnostic(diagnostic_info*)
???:0
0x285c505 diagnostic_context::diagnostic_impl(rich_location*,
diagnostic_metadata const*, diagnostic_option_id, char const*, __va_list_tag
(*) [1], diagnostic_t)
???:0
0x286fbcf error_at(unsigned int, char const*, ...)
???:0
0xd70f1e build_c_cast(unsigned int, tree_node*, cp_expr)
???:0
0xc989da c_parse_file()
???:0
0xdf0599 c_common_parse_file()
???:0
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See  for instructions.
Compiler returned: 1
```

[Bug c++/117107] New: internal compiler error: Segmentation fault at lookup_decomp_type(tree_node*)

2024-10-12 Thread yihan4845 at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117107

Bug ID: 117107
   Summary: internal compiler error: Segmentation fault at
lookup_decomp_type(tree_node*)
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: yihan4845 at gmail dot com
  Target Milestone: ---

Compiler Explorer: https://godbolt.org/z/dMP9rdf1M

The following program:
```cpp
template 
constexpr bool is_same = false;
template 
constexpr bool is_same = true;

struct tuple {
  template 
  void check_tuple_like() {
tuple t;
auto [v, r] = t;
(void)[v, r] {
decltype(v);
};
  }
  int a = 0;
  int &b = a;
};
```

will trigger segmentation fault for gcc trunk.

The stack dump:
```
0x285c505 diagnostic_context::diagnostic_impl(rich_location*,
diagnostic_metadata const*, diagnostic_option_id, char const*, __va_list_tag
(*) [1], diagnostic_t)
???:0
0x28702e5 internal_error(char const*, ...)
???:0
0xb796f5 lookup_decomp_type(tree_node*)
???:0
0xd1e956 finish_decltype_type(tree_node*, bool, int)
???:0
0xc989da c_parse_file()
???:0
0xdf0599 c_common_parse_file()
???:0
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See  for instructions.
Compiler returned: 1
```

[Bug c++/117152] New: Segmentation fault in permerror(unsigned int, char const*, ...)

2024-10-15 Thread yihan4845 at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117152

Bug ID: 117152
   Summary: Segmentation fault in permerror(unsigned int, char
const*, ...)
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: yihan4845 at gmail dot com
  Target Milestone: ---

Compiler Explorer: https://godbolt.org/z/jYKsrhPY1

The following program:
```cpp
template struct S {};
struct X {
friend constexpr S::S(S&& = {0}) noexcept;
};
```

will trigger segmentation fault for gcc trunk.

Stack dump:
```
Segmentation fault
0x286a525 diagnostic_context::diagnostic_impl(rich_location*,
diagnostic_metadata const*, diagnostic_option_id, char const*, __va_list_tag
(*) [1], diagnostic_t)
???:0
0x287e305 internal_error(char const*, ...)
???:0
0x28a10f3 pretty_printer::format(text_info&)
???:0
0x286a242 diagnostic_context::report_diagnostic(diagnostic_info*)
???:0
0x286a525 diagnostic_context::diagnostic_impl(rich_location*,
diagnostic_metadata const*, diagnostic_option_id, char const*, __va_list_tag
(*) [1], diagnostic_t)
???:0
0x287d4bf permerror(unsigned int, char const*, ...)
???:0
0xb6d4d1 grokdeclarator(cp_declarator const*, cp_decl_specifier_seq*,
decl_context, int, tree_node**)
???:0
0xb8e620 grokfield(cp_declarator const*, cp_decl_specifier_seq*, tree_node*,
bool, tree_node*, tree_node*)
???:0
0xc98ffa c_parse_file()
???:0
0xdf0c19 c_common_parse_file()
???:0
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See  for instructions.
Compiler returned: 1
```

[Bug c++/117129] New: internal compiler error: Segmentation fault at gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), int)

2024-10-13 Thread yihan4845 at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117129

Bug ID: 117129
   Summary: internal compiler error: Segmentation fault at
gimplify_expr(tree_node**, gimple**, gimple**, bool
(*)(tree_node*), int)
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: yihan4845 at gmail dot com
  Target Milestone: ---

Compiler Explorer: https://godbolt.org/z/6fzd6j9G9

The following program:
```cpp
struct Noncopyable {
  Noncopyable();
  Noncopyable(const Noncopyable &) = delete; 
  virtual ~Noncopyable();
};
Noncopyable nrvo() { 
  {
Noncopyable A;
return A;
  } 
}
```

will trigger segmentation fault for gcc trunk.

Stack dump:
```
cc1plus: internal compiler error: Segmentation fault
0x2867155 diagnostic_context::diagnostic_impl(rich_location*,
diagnostic_metadata const*, diagnostic_option_id, char const*, __va_list_tag
(*) [1], diagnostic_t)
???:0
0x287af35 internal_error(char const*, ...)
???:0
0x1099ec8 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
???:0
0x109d2ca gimplify_stmt(tree_node**, gimple**)
???:0
0x1099c20 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
???:0
0x109d2ca gimplify_stmt(tree_node**, gimple**)
???:0
0x109afb3 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
???:0
0x109d2ca gimplify_stmt(tree_node**, gimple**)
???:0
0x109a625 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
???:0
0x109d2ca gimplify_stmt(tree_node**, gimple**)
???:0
0x109afb3 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
???:0
0x109d2ca gimplify_stmt(tree_node**, gimple**)
???:0
0x109a625 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
???:0
0x10a3473 gimplify_body(tree_node*, bool)
???:0
0x10a38b9 gimplify_function_tree(tree_node*)
???:0
0xec1f47 cgraph_node::analyze()
???:0
0xec52a1 symbol_table::finalize_compilation_unit()
???:0
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See  for instructions.
Compiler returned: 1
```

[Bug c++/117130] New: internal compiler error: in add_stmt, at cp/semantics.cc:551

2024-10-13 Thread yihan4845 at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117130

Bug ID: 117130
   Summary: internal compiler error: in add_stmt, at
cp/semantics.cc:551
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: yihan4845 at gmail dot com
  Target Milestone: ---

Compiler Explorer: https://godbolt.org/z/qM3dnM193

The following program:
```
constexpr auto x = [] (auto F) { return F(); }; 
_Alignof(const auto);
static_assert(x([]() { return 1; }) == 1);
```

will trigger segmentation fault for gcc trunk.

Stack dump:
```
0x2867155 diagnostic_context::diagnostic_impl(rich_location*,
diagnostic_metadata const*, diagnostic_option_id, char const*, __va_list_tag
(*) [1], diagnostic_t)
???:0
0x287af35 internal_error(char const*, ...)
???:0
0xa8c71a fancy_abort(char const*, int, char const*)
???:0
0xd1fb24 finish_static_assert(tree_node*, tree_node*, unsigned int, bool, bool)
???:0
0xc9a3aa c_parse_file()
???:0
0xdf1f69 c_common_parse_file()
???:0
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See  for instructions.
Compiler returned: 1
```

[Bug c++/117153] New: internal compiler error: Segmentation fault at is_overloaded_fn(tree_node*)

2024-10-15 Thread yihan4845 at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117153

Bug ID: 117153
   Summary: internal compiler error: Segmentation fault at
is_overloaded_fn(tree_node*)
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: yihan4845 at gmail dot com
  Target Milestone: ---

Compiler Explorer: https://godbolt.org/z/fYPcEoEa7

The following program:
```
template
void f() { 
  union { 
union {
  T d;
};
  };
  d + 0;
}
template void f();
```

will trigger segmentation fault for gcc trunk.


The stack dump:
```
0x286a525 diagnostic_context::diagnostic_impl(rich_location*,
diagnostic_metadata const*, diagnostic_option_id, char const*, __va_list_tag
(*) [1], diagnostic_t)
???:0
0x287e305 internal_error(char const*, ...)
???:0
0xd3d270 is_overloaded_fn(tree_node*)
???:0
0xb020aa potential_constant_expression(tree_node*)
???:0
0xcc0add instantiate_decl(tree_node*, bool, bool)
???:0
0xcfb74b instantiate_pending_templates(int)
???:0
0xb90b1b c_parse_final_cleanups()
???:0
0xdf0c48 c_common_parse_file()
???:0
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See  for instructions.
Compiler returned: 1
```

[Bug c++/117044] New: Recursive template instantiation crashes gcc trunk: Segmentation fault signal terminated program cc1plus

2024-10-09 Thread yihan4845 at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117044

Bug ID: 117044
   Summary: Recursive template instantiation crashes gcc trunk:
Segmentation fault signal terminated program cc1plus
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: yihan4845 at gmail dot com
  Target Milestone: ---

The following illformed code crashes current gcc trunk. This code was generated
by a fuzzer.

Compiler Explorer: https://godbolt.org/z/5v85M1Ea9

Code:

template T v;
template decltype(v) v;
int k = v;

Compilation result:

g++: internal compiler error: Segmentation fault signal terminated program
cc1plus
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
See  for instructions.
Compiler returned: 4

[Bug c++/117101] New: internal compiler error: Segmentation fault for operator new

2024-10-11 Thread yihan4845 at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117101

Bug ID: 117101
   Summary: internal compiler error: Segmentation fault for
operator new
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: yihan4845 at gmail dot com
  Target Milestone: ---

Compiler Explorer: https://godbolt.org/z/hrooe5sn8

The following program:
```cpp
using size_t = decltype(sizeof(int));
void *operator new(size_t, void void **p) noexcept { return p; }
int x;
void f() {
int y;
new (&y) int(x);
}
```

will trigger segmentation fault for gcc trunk only.

The stack dump:
```
0x2854355 diagnostic_context::diagnostic_impl(rich_location*,
diagnostic_metadata const*, diagnostic_option_id, char const*, __va_list_tag
(*) [1], diagnostic_t)
???:0
0x2868135 internal_error(char const*, ...)
???:0
0xbb4a2f build_new(unsigned int, vec**,
tree_node*, tree_node*, vec**, int, int)
???:0
0xc98d9a c_parse_file()
???:0
0xdf0959 c_common_parse_file()
???:0
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See  for instructions.
Compiler returned: 1
```

[Bug c++/117099] New: internal compiler error: Segmentation fault in finalize_nrv(tree_node*, tree_node*)

2024-10-11 Thread yihan4845 at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117099

Bug ID: 117099
   Summary: internal compiler error: Segmentation fault in
finalize_nrv(tree_node*, tree_node*)
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: yihan4845 at gmail dot com
  Target Milestone: ---

Compiler Explorer: https://godbolt.org/z/noKj48czq

The following program:
```cpp
class X {
public:
  X();
  ~X();
};
X test(bool b) {
  {
X x;
return x;
  } 
  return X(); 
  if (!(b)) return;
}
```

will trigger segmentation fault for gcc trunk only.

The stack dump:
```
0x2854355 diagnostic_context::diagnostic_impl(rich_location*,
diagnostic_metadata const*, diagnostic_option_id, char const*, __va_list_tag
(*) [1], diagnostic_t)
???:0
0x2868135 internal_error(char const*, ...)
???:0
0x17608fc walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set >*,
tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set >*))
???:0
0x1760b12 walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set >*,
tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set >*))
???:0
0x1760fed walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set >*,
tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set >*))
???:0
0xd22533 finalize_nrv(tree_node*, tree_node*)
???:0
0xb76e20 finish_function(bool)
???:0
0xc98d9a c_parse_file()
???:0
0xdf0959 c_common_parse_file()
???:0
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See  for instructions.
Compiler returned: 1
```

[Bug c++/117102] New: internal compiler error: tree check: accessed elt 2 of 'tree_vec' with 1 elts in unify, at cp/pt.cc:24866

2024-10-11 Thread yihan4845 at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117102

Bug ID: 117102
   Summary: internal compiler error: tree check: accessed elt 2 of
'tree_vec' with 1 elts in unify, at cp/pt.cc:24866
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: yihan4845 at gmail dot com
  Target Milestone: ---

Compiler Explorer: https://godbolt.org/z/qx5TTdE3d

The following program:
```cpp
template struct S;
template struct S {};

class Bar {
void f(){}
S<0, &Bar::f> c;
};
```

will trigger segmentation fault for gcc trunk.

Stack dump:
```
0x2854355 diagnostic_context::diagnostic_impl(rich_location*,
diagnostic_metadata const*, diagnostic_option_id, char const*, __va_list_tag
(*) [1], diagnostic_t)
???:0
0x2868135 internal_error(char const*, ...)
???:0
0x99bfd7 tree_vec_elt_check_failed(int, int, char const*, int, char const*)
???:0
0xb05396 tree_vec_elt_check(tree_node*, int, char const*, int, char const*)
???:0
0xcb7d71 do_auto_deduction(tree_node*, tree_node*, tree_node*, int,
auto_deduction_context, tree_node*, int, tree_node*)
???:0
0xcbf5c5 most_specialized_partial_spec(tree_node*, int, bool)
???:0
0xcf8e35 instantiate_class_template(tree_node*)
???:0
0xb6e767 grokdeclarator(cp_declarator const*, cp_decl_specifier_seq*,
decl_context, int, tree_node**)
???:0
0xb8e3c0 grokfield(cp_declarator const*, cp_decl_specifier_seq*, tree_node*,
bool, tree_node*, tree_node*)
???:0
0xc98d9a c_parse_file()
???:0
0xdf0959 c_common_parse_file()
???:0
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See  for instructions.
Compiler returned: 1
```

[Bug c++/117345] New: internal compiler error: Segmentation fault at maybe_begin_member_template_processing(tree_node*)

2024-10-29 Thread yihan4845 at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117345

Bug ID: 117345
   Summary: internal compiler error: Segmentation fault at
maybe_begin_member_template_processing(tree_node*)
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: yihan4845 at gmail dot com
  Target Milestone: ---

Compiler Explorer: https://godbolt.org/z/G8Tad87or

The following program:
```cpp
struct X {
  template static decltype(auto) g0(T x) { return x; }
};
template class A {
  friend decltype(auto) X::g0<>(A = 0);
};
```

will trigger segmentation fault for gcc trunk.

Stack dump:
```
0x287e395 diagnostic_context::diagnostic_impl(rich_location*,
diagnostic_metadata const*, diagnostic_option_id, char const*, __va_list_tag
(*) [1], diagnostic_t)
???:0
0x28947f5 internal_error(char const*, ...)
???:0
0xcb47c1 maybe_begin_member_template_processing(tree_node*)
???:0
0xc9e55a c_parse_file()
???:0
0xdf7f79 c_common_parse_file()
???:0
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See  for instructions.
Compiler returned: 1
```

[Bug c++/117273] New: internal compiler error: Segmentation fault at extend_ref_init_temps(tree_node*, tree_node*, vec**, tree_node**)

2024-10-23 Thread yihan4845 at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117273

Bug ID: 117273
   Summary: internal compiler error: Segmentation fault at
extend_ref_init_temps(tree_node*, tree_node*,
vec**, tree_node**)
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: yihan4845 at gmail dot com
  Target Milestone: ---

Compiler Explorer: https://godbolt.org/z/dfdsq58Yd

The following program:
```
namespace std {
  typedef __SIZE_TYPE__ size_t;
  template struct initializer_list {
const T *p; size_t n;
const T *p, size_t n;
  };
}
struct C { std::initializer_list a; };
C c = {};
```

will trigger segmentation fault for gcc trunk.

The stack dump:
```
0x286e9b5 diagnostic_context::diagnostic_impl(rich_location*,
diagnostic_metadata const*, diagnostic_option_id, char const*, __va_list_tag
(*) [1], diagnostic_t)
???:0
0x2882d95 internal_error(char const*, ...)
???:0
0xac5a1a extend_ref_init_temps(tree_node*, tree_node*, vec**, tree_node**)
???:0
0xac5bb1 extend_ref_init_temps(tree_node*, tree_node*, vec**, tree_node**)
???:0
0xd7a0da store_init_value(tree_node*, tree_node*, vec**, int)
???:0
0xb7e50e cp_finish_decl(tree_node*, tree_node*, bool, tree_node*, int,
cp_decomp*)
???:0
0xc9a1da c_parse_file()
???:0
0xdf3b39 c_common_parse_file()
???:0
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See  for instructions.
Compiler returned: 1
```

[Bug c++/117324] New: internal compiler error: Segmentation fault in break_out_target_exprs(tree_node*, bool)

2024-10-27 Thread yihan4845 at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117324

Bug ID: 117324
   Summary: internal compiler error: Segmentation fault in
break_out_target_exprs(tree_node*, bool)
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: yihan4845 at gmail dot com
  Target Milestone: ---

Compiler Explorer: https://godbolt.org/z/869j3xz9o

The following program:
```cpp
template
struct ct1 {
  friend void f(ct1, int = [](int p = [] { }) { return p; }(); ) {}
};
void test() {
  f(ct1{});
}
```

will trigger segmentation fault for gcc trunk.

Stack dump:
```
0x287e175 diagnostic_context::diagnostic_impl(rich_location*,
diagnostic_metadata const*, diagnostic_option_id, char const*, __va_list_tag
(*) [1], diagnostic_t)
???:0
0x28945d5 internal_error(char const*, ...)
???:0
0xaa99c4 set_flags_from_callee(tree_node*)
???:0
0x176a8dc walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set >*,
tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set >*))
???:0
0xd43852 break_out_target_exprs(tree_node*, bool)
???:0
0xab019c convert_default_arg(tree_node*, tree_node*, tree_node*, int, int)
???:0
0xac095e build_new_function_call(tree_node*, vec**, int)
???:0
0xd1c8f6 finish_call_expr(tree_node*, vec**, bool,
bool, int)
???:0
0xc9e57a c_parse_file()
???:0
0xdf7f99 c_common_parse_file()
???:0
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See  for instructions.
Compiler returned: 1
```

[Bug c++/117534] New: internal compiler error: Segmentation fault at check_explicit_specialization(tree_node*, tree_node*, int, int, tree_node*)

2024-11-11 Thread yihan4845 at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117534

Bug ID: 117534
   Summary: internal compiler error: Segmentation fault at
check_explicit_specialization(tree_node*, tree_node*,
int, int, tree_node*)
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: yihan4845 at gmail dot com
  Target Milestone: ---

Compiler Explorer: https://godbolt.org/z/f9Wq36qeb

The following valid program:
```cpp
template 
void j(int i = 0, Ts... ts) {}
template <>
void j(int i, int j, int *p, int *q) {}
```

will trigger segmentation fault for gcc trunk.


Stack dump:
```
0x289aac5 diagnostic_context::diagnostic_impl(rich_location*,
diagnostic_metadata const*, diagnostic_option_id, char const*, __va_list_tag
(*) [1], diagnostic_t)
???:0
0x28b14b5 internal_error(char const*, ...)
???:0
0xd04cae check_explicit_specialization(tree_node*, tree_node*, int, int,
tree_node*)
???:0
0xb7389c grokdeclarator(cp_declarator const*, cp_decl_specifier_seq*,
decl_context, int, tree_node**)
???:0
0xb7683a start_function(cp_decl_specifier_seq*, cp_declarator const*,
tree_node*)
???:0
0xca0a8a c_parse_file()
???:0
0xdfab89 c_common_parse_file()
???:0
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See  for instructions.
Compiler returned: 1
```

[Bug c++/117535] New: Segmentation fault signal terminated program cc1plus with recursive lambda

2024-11-11 Thread yihan4845 at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117535

Bug ID: 117535
   Summary: Segmentation fault signal terminated program cc1plus
with recursive lambda
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: yihan4845 at gmail dot com
  Target Milestone: ---

Compiler Explorer: https://godbolt.org/z/3vazW8dq9

The following program:
```cpp
template void f(T a, int = f([] {}));
void g() { f(0); }
```

will trigger segmentation fault for gcc trunk.

Stack dump:
```
g++: internal compiler error: Segmentation fault signal terminated program
cc1plus
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
See  for instructions.
Compiler returned: 4
```

[Bug c++/117511] New: internal compiler error: Segmentation fault at mark_used(tree_node*, int)

2024-11-09 Thread yihan4845 at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117511

Bug ID: 117511
   Summary: internal compiler error: Segmentation fault at
mark_used(tree_node*, int)
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: yihan4845 at gmail dot com
  Target Milestone: ---

Compiler Explorer: https://godbolt.org/z/KnW9jY9hM

The following program:
```cpp
template struct S { };
template
class A {
  static char check(S);
public:
  static const bool value = (sizeof(check(0)) == sizeof(char));
};
void foo() {
  A::value;
}

```

will trigger segmentation fault for gcc trunk.

Stack dump:
```
0x289ac95 diagnostic_context::diagnostic_impl(rich_location*,
diagnostic_metadata const*, diagnostic_option_id, char const*, __va_list_tag
(*) [1], diagnostic_t)
???:0
0x28b1685 internal_error(char const*, ...)
???:0
0xcc84b6 instantiate_decl(tree_node*, bool, bool)
???:0
0xb9380b mark_used(tree_node*, int)
???:0
0xd2e5ab finish_id_expression(tree_node*, tree_node*, tree_node*, cp_id_kind*,
bool, bool, bool*, bool, bool, bool, bool, char const**, unsigned int)
???:0
0xca0a6a c_parse_file()
???:0
0xdfab69 c_common_parse_file()
???:0
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See  for instructions.
Compiler returned: 1
```

[Bug c++/117533] New: internal compiler error: Segmentation fault signal terminated program cc1plus with incomplete type

2024-11-11 Thread yihan4845 at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117533

Bug ID: 117533
   Summary: internal compiler error: Segmentation fault signal
terminated program cc1plus with incomplete type
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: yihan4845 at gmail dot com
  Target Milestone: ---

Compiler Explorer: https://godbolt.org/z/bzPojo1W4

The following program:
```cpp
class Empty {};
void use() {
  [](volatile class Empty ;) {};
}
```

will trigger segmentation fault for gcc trunk.

Stack dump:
```
g++: internal compiler error: Segmentation fault signal terminated program
cc1plus
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
See  for instructions.
Compiler returned: 4
```

[Bug c++/117463] New: internal compiler error: Segmentation fault at is_nondependent_constant_expression(tree_node*)

2024-11-05 Thread yihan4845 at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117463

Bug ID: 117463
   Summary: internal compiler error: Segmentation fault at
is_nondependent_constant_expression(tree_node*)
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: yihan4845 at gmail dot com
  Target Milestone: ---

Compiler Explorer: https://godbolt.org/z/Gcq31jrGG

The following program:
```cpp
struct S {};
void *operator new[] (unsigned long, void void *volatile p) { return p; }
S *fun(void *p) {
  return new(p) S[10];
}
```

will trigger segmentation fault for gcc trunk.

Stack dump:
```
0x28849d5 diagnostic_context::diagnostic_impl(rich_location*,
diagnostic_metadata const*, diagnostic_option_id, char const*, __va_list_tag
(*) [1], diagnostic_t)
???:0
0x289b3c5 internal_error(char const*, ...)
???:0
0xb09b40 is_nondependent_constant_expression(tree_node*)
???:0
0xb0ae74 maybe_constant_value(tree_node*, tree_node*, mce_value)
???:0
0xbaeb03 fold_for_warn(tree_node*)
???:0
0xd76308 check_return_expr(tree_node*, bool*, bool*)
???:0
0xd19818 finish_return_stmt(tree_node*)
???:0
0xca0b0a c_parse_file()
???:0
0xdfa809 c_common_parse_file()
???:0
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See  for instructions.
Compiler returned: 1
```

[Bug c++/117462] New: internal compiler error: comptypes(tree_node*, tree_node*, int)

2024-11-05 Thread yihan4845 at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117462

Bug ID: 117462
   Summary: internal compiler error: comptypes(tree_node*,
tree_node*, int)
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: yihan4845 at gmail dot com
  Target Milestone: ---

Compiler Explorer: https://godbolt.org/z/MrdYMGq6G

The following program:
```cpp
struct A {};
struct Nested { union { int k; int arr[2]; }; };
struct Derived2 : A, Nested { virtual void g(); };
struct D4 { void (Derived2::*p)(); };
template  struct S1 { static void fn() {} };
template void S1::fn();
```

will trigger segmentation fault for gcc trunk.

Stack dump:
```
0x28849d5 diagnostic_context::diagnostic_impl(rich_location*,
diagnostic_metadata const*, diagnostic_option_id, char const*, __va_list_tag
(*) [1], diagnostic_t)
???:0
0x289b3c5 internal_error(char const*, ...)
???:0
0xd5f47f comptypes(tree_node*, tree_node*, int)
???:0
0xbd70d6 mangle_decl(tree_node*)
???:0
0x1748a85 decl_assembler_name(tree_node*)
???:0
0xece0c1 symbol_table::finalize_compilation_unit()
???:0
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See  for instructions.
Compiler returned: 1
```