https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100254
Bug ID: 100254 Summary: [11/12 Regression] -fcompare-debug failure (length) with -O2 -fno-guess-branch-probability -fipa-pta -fnon-call-exceptions Product: gcc Version: 12.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: debug Assignee: unassigned at gcc dot gnu.org Reporter: zsojka at seznam dot cz CC: aoliva at gcc dot gnu.org Target Milestone: --- Host: x86_64-pc-linux-gnu Created attachment 50673 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50673&action=edit auto-reduced testcase (from OpenTTD sources) Compiler output: $ x86_64-pc-linux-gnu-g++ -O2 -mtune=goldmont -fno-guess-branch-probability -fipa-pta -fnon-call-exceptions -fcompare-debug testcase.C testcase.C:20:38: warning: friend declaration 'bool operator!=(_Rb_tree_const_iterator<_Tp>::_Self, _Rb_tree_const_iterator<_Tp>::_Self)' declares a non-template function [-Wnon-template-friend] 20 | friend bool operator!=(_Self, _Self); | ^ testcase.C:20:38: note: (if this is not what you intended, make sure the function template has already been declared and add '<>' after the function name here) testcase.C: In member function 'bool CargoSorter::operator()(const CargoDataEntry*, const CargoDataEntry*) const': testcase.C:82:61: warning: no return statement in function returning non-void [-Wreturn-type] 82 | const CargoDataEntry *) const {} | ^ x86_64-pc-linux-gnu-g++: error: testcase.C: '-fcompare-debug' failure (length) $ x86_64-pc-linux-gnu-g++ -v Using built-in specs. COLLECT_GCC=/repo/gcc-trunk/binary-latest/bin/x86_64-pc-linux-gnu-g++ COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-r12-100-20210424001429-gbcd77b7b9f3-checking-yes-rtl-df-extra-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/12.0.0/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++ --enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra --with-cloog --with-ppl --with-isl --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu --with-ld=/usr/bin/x86_64-pc-linux-gnu-ld --with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch --prefix=/repo/gcc-trunk//binary-trunk-r12-100-20210424001429-gbcd77b7b9f3-checking-yes-rtl-df-extra-amd64 Thread model: posix Supported LTO compression algorithms: zlib zstd gcc version 12.0.0 20210424 (experimental) (GCC)