https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108496
Bug ID: 108496 Summary: [13 Regression] NRV ICE since r13-4469 Product: gcc Version: 13.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: jakub at gcc dot gnu.org Target Milestone: --- Since r13-4469-gd19aa6af6634b1e97f38431ad091f3b3f12baf2f we ICE with -O2 on: struct S { long a, b, c; } s; template <int, typename> S foo (S); template <> S foo <0, long> (S) { return s; } template S foo <0, long> (S); during GIMPLE pass: nrv rh2163383.ii: In function ‘S foo(S) [with int <anonymous> = 0; <template-parameter-1-2> = long int]’: rh2163383.ii:8:1: internal compiler error: in execute, at tree-nrv.cc:179 8 | foo <0, long> (S) | ^~~~~~~~~~~~~ tree-nrv.cc:179 is: gcc_assert (ret_val == result);