https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93873
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |missed-optimization Component|c |middle-end --- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> --- I suspect this is just a missed optimization. The -Wfree-nonheap-object warning is done after the majority of optimizations have happened. Also since you are using a non-supported GCC version, there is not much we can do for that version. Try a newer version of GCC.