https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105867
Andrea Griffini <agriff at tin dot it> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |agriff at tin dot it --- Comment #4 from Andrea Griffini <agriff at tin dot it> --- Created attachment 53891 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53891&action=edit Simpler version that triggers the bug This code compiled on 12.2.0 with -O3 -Wall generates a warning about storing the address of a local variable. Surprisingly (for me) adding either of the two `printf` statements makes the warning go away. The code seems correct to me; a doubly linked list of all instances of Node is kept by inserting nodes in constructor and removing them in destructor.