https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118865
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Component|c++ |tree-optimization Summary|[15 regression] |[12/13/14/15 regression] |-Wfree-nonheap-object false |-Wfree-nonheap-object false |positive |positive Target Milestone|--- |12.5 --- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- So there is a false positive but there is also true positive here. The true positive is due to processJetContainer assumes `jbeg != bend`. Adding: if (jbeg == jend) __builtin_unreachable(); To the begining of the function gets rid of one reason for the warning but there is still another. Note the difference between GCC 14 and 15 is: # _34 = PHI <&listJets.D.39335._M_impl._M_node.D.18822(4), &MEM[(struct _List_node_header *)&listJets].D.18822(2)> vs &MEM[(struct _List_node_header *)&listJets].D.18258 directly. And getting rid of the true positive makes GCC 14 warn on the false positive.