https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111921
Bug ID: 111921
Summary: GCC: 14: internal compiler error: Segmentation fault
Product: gcc
Version: 14.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: 141242068 at smail dot nju.edu.cn
Target Milestone: ---
When compile this program with GCC, gcc segfaults:
```
_Atomic(int) a;
const double b;
int main(void) {
void f(void *arg) { return ; }
return a |= b;
}
```
The function definition `f` inside main is essential to trigger this segfault,
without this func, GCC simply reports an error.
Compiler Explorer: https://gcc.godbolt.org/z/P58W6ssaG
The stack dump:
```
<source>: In function 'main':
<source>:5:12: error: invalid operands to binary | (have 'int' and 'double')
5 | return a |= b;
| ~~~~~~ ^~
| |
| int
<source>:3:5: internal compiler error: Segmentation fault
3 | int main(void) {
| ^~~~
0x231f49e internal_error(char const*, ...)
???:0
0x1462bbc 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
0xda9275 walk_gimple_op(gimple*, tree_node* (*)(tree_node**, int*, void*),
walk_stmt_info*)
???:0
0xda96e9 walk_gimple_stmt(gimple_stmt_iterator*, tree_node*
(*)(gimple_stmt_iterator*, bool*, walk_stmt_info*), tree_node* (*)(tree_node**,
int*, void*), walk_stmt_info*)
???:0
0xda9888 walk_gimple_seq_mod(gimple**, tree_node* (*)(gimple_stmt_iterator*,
bool*, walk_stmt_info*), tree_node* (*)(tree_node**, int*, void*),
walk_stmt_info*)
???:0
0xda9761 walk_gimple_stmt(gimple_stmt_iterator*, tree_node*
(*)(gimple_stmt_iterator*, bool*, walk_stmt_info*), tree_node* (*)(tree_node**,
int*, void*), walk_stmt_info*)
???:0
0xda9888 walk_gimple_seq_mod(gimple**, tree_node* (*)(gimple_stmt_iterator*,
bool*, walk_stmt_info*), tree_node* (*)(tree_node**, int*, void*),
walk_stmt_info*)
???:0
0xda9761 walk_gimple_stmt(gimple_stmt_iterator*, tree_node*
(*)(gimple_stmt_iterator*, bool*, walk_stmt_info*), tree_node* (*)(tree_node**,
int*, void*), walk_stmt_info*)
???:0
0xda9888 walk_gimple_seq_mod(gimple**, tree_node* (*)(gimple_stmt_iterator*,
bool*, walk_stmt_info*), tree_node* (*)(tree_node**, int*, void*),
walk_stmt_info*)
???:0
0x11cef6b lower_nested_functions(tree_node*)
???:0
0xbea49e cgraph_node::analyze()
???:0
0xbee231 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 <https://gcc.gnu.org/bugs/> for instructions.
```