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

            Bug ID: 120593
           Summary: internal compiler error: in fold_convert_loc, at
                    fold-const.cc:2662 since 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 program:

```
#include <iostream>
constexpr int mul(int i, int j, int k) {
        return i * j * k;
}
int main() {
        auto new_mul2 = ::std::apply<int(*)(double,double, double),
::std::tuple<double, double, double>>(mul, std::tuple{ 1.2, 2.3, 3.4 });
}
```

Stack dump:

```
/opt/compiler-explorer/gcc-trunk-20250608/include/c++/16.0.0/bits/invoke.h:63:36:
internal compiler error: in fold_convert_loc, at fold-const.cc:2662
   63 |     { return std::forward<_Fn>(__f)(std::forward<_Args>(__args)...); }
      |              ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0x282f1c5 diagnostic_context::diagnostic_impl(rich_location*,
diagnostic_metadata const*, diagnostic_option_id, char const*, __va_list_tag
(*) [1], diagnostic_t)
        ???:0
0x284d556 internal_error(char const*, ...)
        ???:0
0xadeeec fancy_abort(char const*, int, char const*)
        ???:0
0xb8c73b cp_fold_convert(tree_node*, tree_node*)
        ???:0
0xb5bcf9 maybe_constant_value(tree_node*, tree_node*, mce_value)
        ???:0
0xb880d9 cp_fully_fold_init(tree_node*)
        ???:0
0xded24c store_init_value(tree_node*, tree_node*, vec<tree_node*, va_gc,
vl_embed>**, int)
        ???:0
0xbd8c6e cp_finish_decl(tree_node*, tree_node*, bool, tree_node*, int,
cp_decomp*)
        ???:0
0xd049b3 c_parse_file()
        ???:0
0xe6c5b9 c_common_parse_file()
        ???:0
```


To quickly reproduce:

https://godbolt.org/z/v7n711zfr

Reply via email to