https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101839
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|[9/10/11/12 Regression] |[9/10/11/12 Regression] |Hand in C++ code with |Hang in C++ code with |-fdevirtualize |-fdevirtualize Known to fail| |10.3.0, 11.2.1, 7.5.0, | |9.4.0 Target Milestone|--- |9.5 Priority|P3 |P2 --- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> --- BA::fill can be declared virtual without any change (it is implicitely so as stated by the C++ standard it seems). With GCC 11 and -O -fdevirtualize the program crashes and we see void {anonymous}::BA::fill (struct BA * const this, struct Buf & buf) { <bb 2> [count: 0]: __builtin_unreachable (); which is from a-t.C.083i.inline:t.C:16:14: optimized: folding virtual function call to __builtin_unreachable a-t.C.083i.inline:Introduced new external node (void __builtin_unreachable()/1356). a-t.C.083i.inline:t.C:17:14: optimized: folding virtual function call to __builtin_unreachable