https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90587
Bug ID: 90587 Summary: asan: stack-use-after-scope with -O3 and -Wall Product: gcc Version: 9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: dcb314 at hotmail dot com Target Milestone: --- Created attachment 46399 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=46399&action=edit C++ source code The attached C++ code does this: ==7322==ERROR: AddressSanitizer: stack-use-after-scope on address 0x7fffebf37620 at pc 0x00000390b2ba bp 0x7fffebf373e0 sp 0x7fffebf373d8 when compiled like this: $ /home/dcb/gcc/results.271500.asan/bin/gcc -O3 -Wall -std=c++11 bug522.cc The bug seems to start sometime between revision 271200 and 271500. I will post reduced C++ code when I get it.