https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105769
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|--- |11.4 Known to work| |10.3.0 Known to fail| |11.3.0, 12.1.0 Summary|program segmentation fault |[11/12/13 Regression] |with -ftree-vectorize and |program segmentation fault |nested lambdas |with -ftree-vectorize and | |nested lambdas --- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> --- It segfaults doing an indirect call #0 0x0000000000000001 in ?? () #1 0x0000000000400c9d in std::_Function_base::~_Function_base ( this=<optimized out>, this=<optimized out>) at /home/space/rguenther/install/gcc-11.3/include/c++/11.3.0/bits/std_function.h:244 #2 0x00000000004011f1 in std::function<unsigned long (unsigned long)>::~function() (this=<optimized out>, this=<optimized out>) at /home/space/rguenther/install/gcc-11.3/include/c++/11.3.0/bits/std_function.h:334 #3 print_cov_ratio<ab> () at /tmp/t.C:86 #4 main () at /tmp/t.C:122 with -fno-lifetime-dse it works fine. I suspect that either GCC or the source gets things wrong WRT object lifetime in the maze of lambdas. It's interesting that with -fsanitize=undefined added we still vectorize but exactly a single load/store: t.C:65:3: optimized: basic block part vectorized using 16 byte vectors and then it still crashes. 0x0000000000401027 <+97>: mov %rbx,%rdi 0x000000000040102a <+100>: call *%rbp => 0x000000000040102c <+102>: add $0x8,%rsp (gdb) p $rbp $1 = (void *) 0x1 More investigation is needed.