https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103843
Georgii.Shagov <georgii.sha...@be-tse.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|INVALID |FIXED --- Comment #3 from Georgii.Shagov <georgii.sha...@be-tse.de> --- (In reply to Andrew Pinski from comment #2) > This is undefined code. The object is officially not live after you call the > deconstructor so GCC is able to remove the store from the deconstructor as > being dead. I appreciate your reply. But this is confusing. The object was NOT released (de-allocated). In essence Destructor is just a function. Why the content of the class had been re-initialized? IMU: there should be not such obvious difference between optimized and non-optimized code thnx in advance.