https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105769
Bug ID: 105769 Summary: program segmentation fault with -ftree-vectorize and nested lambdas Product: gcc Version: 11.2.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: sliwa at ifpan dot edu.pl Target Milestone: --- Created attachment 53050 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53050&action=edit sample program demonstrating undefined behavior The attached program triggers undefined behavior with g++ (the resulting binary segfaults in the manager code of a functor wrapper) when compiled as follows (minimal flags to trigger): g++ -flto -O1 -ftree-vectorize tst.cc This may be related to memory alignment of data (I see a crash with long double, but not with double). Other things to check is the capture of functor est in program line 57 (adding an ampersand eliminates the issue). Even changing the data in lines 81-82 (for example to 0) affects the outcome. Platform: amd64, RHEL or Gentoo Linux.