https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118278
Bug ID: 118278 Summary: [15 Regression] ICE in write_template_arg_literal Product: gcc Version: 15.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: --- // { dg-do compile { target c++20 } } // { dg-options -fabi-compat-version=0 } struct C { unsigned char a[5], b[5], c[128]; }; template <C> struct Y { }; typedef Y<C{ {1,2}, {}, { #embed __FILE__ __limit__ (128) } }> Tca; void g (Tca) { } // { dg-final { scan-assembler "_Z1g1YIXtl1CtlA5_hLh1ELh2EEtlS1_EtlA128_h(?:Lh\[0-9]*E){128}EEEE" } } typedef Y<C{ "\1\2", "", { #embed __FILE__ __limit__ (128) } }> Tcs; void h (Tcs) { } // { dg-final { scan-assembler "_Z1h1YIXtl1CtlA5_hLh1ELh2EEtlS1_EtlA128_h(?:Lh\[0-9]*E){128}EEEE" } } ICEs starting with r15-5958. Similarly, // Verify that class literals are mangled the same way regardless // of the underlying type. // { dg-do compile { target c++20 } } // { dg-additional-options -fabi-compat-version=0 } struct I { int a[5], b[5], c[144]; }; template <I> struct X { }; typedef X<I{ {1,2}, {}, { 101,102,103,104,105,106,255,254,253,252,251,0,1,2,3,4, 101,102,103,104,105,106,255,254,253,252,251,0,1,2,3,4, 101,102,103,104,105,106,255,254,253,252,251,0,1,2,3,4, 101,102,103,104,105,106,255,254,253,252,251,0,1,2,3,4, 101,102,103,104,105,106,255,254,253,252,251,0,1,2,3,4, 101,102,103,104,105,106,255,254,253,252,251,0,1,2,3,4, 101,102,103,104,105,106,255,254,253,252,251,0,1,2,3,4, 101,102,103,104,105,106,255,254,253,252,251,0,1,2,3,4, 101,102,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } }> Ti; void f (Ti) { } // { dg-final { scan-assembler "_Z1f1XIXtl1ItlA5_iLi1ELi2EEtlS1_EtlA144_i(?:Li101ELi102ELi103ELi104ELi105ELi106ELi255ELi254ELi253ELi252ELi251ELi0ELi1ELi2ELi3ELi4E){8}Li101ELi102EEEEE" } } struct C { unsigned char a[5], b[5], c[144]; }; template <C> struct Y { }; typedef Y<C{ {1,2}, {}, { 101,102,103,104,105,106,255,254,253,252,251,0,1,2,3,4, 101,102,103,104,105,106,255,254,253,252,251,0,1,2,3,4, 101,102,103,104,105,106,255,254,253,252,251,0,1,2,3,4, 101,102,103,104,105,106,255,254,253,252,251,0,1,2,3,4, 101,102,103,104,105,106,255,254,253,252,251,0,1,2,3,4, 101,102,103,104,105,106,255,254,253,252,251,0,1,2,3,4, 101,102,103,104,105,106,255,254,253,252,251,0,1,2,3,4, 101,102,103,104,105,106,255,254,253,252,251,0,1,2,3,4, 101,102,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } }> Tca; void g (Tca) { } // { dg-final { scan-assembler "_Z1g1YIXtl1CtlA5_hLh1ELh2EEtlS1_EtlA144_h(?:Lh101ELh102ELh103ELh104ELh105ELh106ELh255ELh254ELh253ELh252ELh251ELh0ELh1ELh2ELh3ELh4E){8}Lh101ELh102EEEEE" } } typedef Y<C{ "\1\2", "", { 101,102,103,104,105,106,255,254,253,252,251,0,1,2,3,4, 101,102,103,104,105,106,255,254,253,252,251,0,1,2,3,4, 101,102,103,104,105,106,255,254,253,252,251,0,1,2,3,4, 101,102,103,104,105,106,255,254,253,252,251,0,1,2,3,4, 101,102,103,104,105,106,255,254,253,252,251,0,1,2,3,4, 101,102,103,104,105,106,255,254,253,252,251,0,1,2,3,4, 101,102,103,104,105,106,255,254,253,252,251,0,1,2,3,4, 101,102,103,104,105,106,255,254,253,252,251,0,1,2,3,4, 101,102,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } }> Tcs; void h (Tcs) { } // { dg-final { scan-assembler "_Z1h1YIXtl1CtlA5_hLh1ELh2EEtlS1_EtlA144_h(?:Lh101ELh102ELh103ELh104ELh105ELh106ELh255ELh254ELh253ELh252ELh251ELh0ELh1ELh2ELh3ELh4E){8}Lh101ELh102EEEEE" } } struct S { signed char a[5], b[5], c[144]; }; template <S> struct Z { }; typedef Z<S{ {1,2}, {}, { 101,102,103,104,105,106,95,94,93,92,91,0,1,2,3,4, 101,102,103,104,105,106,95,94,93,92,91,0,1,2,3,4, 101,102,103,104,105,106,95,94,93,92,91,0,1,2,3,4, 101,102,103,104,105,106,95,94,93,92,91,0,1,2,3,4, 101,102,103,104,105,106,95,94,93,92,91,0,1,2,3,4, 101,102,103,104,105,106,95,94,93,92,91,0,1,2,3,4, 101,102,103,104,105,106,95,94,93,92,91,0,1,2,3,4, 101,102,103,104,105,106,95,94,93,92,91,0,1,2,3,4, 101,102,0,0,0,0,0,0,0,0,0,0,0,0,0,0} }> Tsc; void i (Tsc) { } // { dg-final { scan-assembler "_Z1i1ZIXtl1StlA5_aLa1ELa2EEtlS1_EtlA144_a(?:La101ELa102ELa103ELa104ELa105ELa106ELa95ELa94ELa93ELa92ELa91ELa0ELa1ELa2ELa3ELa4E){8}La101ELa102EEEEE" } } started to ICE with r15-6339 but doesn't ICE since r15-6448 (temporary reversion).