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

Reply via email to