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 <https://gcc.gnu.org/bugs/> for instructions.
Compiler returned: 1
```

Reply via email to