https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120531

            Bug ID: 120531
           Summary: ICE Segmentation fault in gimplify_expr since version
                    13.1
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mario.rodriguezb1 at um dot es
  Target Milestone: ---

ICE on f(E::V1) Segmentation Fault.

## Program

```
#include <iostream>

using namespace std;
enum class E : auto {
  V1
};
template<class U>
constexpr decltype(auto)
f(U&&) { return 3; }

int main() {
  f(E::V1)
}

```

## Stack dump

```
<source>:12:8: internal compiler error: Segmentation fault
   12 |   f(E::V1)
      |     ~~~^~
0x282a0a5 diagnostic_context::diagnostic_impl(rich_location*,
diagnostic_metadata const*, diagnostic_option_id, char const*, __va_list_tag
(*) [1], diagnostic_t)
        ???:0
0x284b7e6 internal_error(char const*, ...)
        ???:0
0x112d9c4 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ???:0
0x112d977 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ???:0
0x113f843 gimplify_arg(tree_node**, gimple**, unsigned long, bool)
        ???:0
0x112cce8 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ???:0
0x112cd37 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ???:0
0x112f8aa gimplify_stmt(tree_node**, gimple**)
        ???:0
0x112c68b gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ???:0
0x114b756 gimplify_body(tree_node*, bool)
        ???:0
0x114bc1c gimplify_function_tree(tree_node*)
        ???:0
0xf3ef77 cgraph_node::analyze()
        ???:0
0xf422f1 symbol_table::finalize_compilation_unit()
        ???:0
```


## To quickly reproduce:

https://godbolt.org/z/6fdTavP94

Reply via email to