https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102958
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Target Milestone|--- |15.0
See Also| |https://gcc.gnu.org/bugzill
| |a/show_bug.cgi?id=92539
Resolution|--- |FIXED
--- Comment #13 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Jonathan Wakely from comment #12)
> (In reply to Jonathan Wakely from comment #11)
> > Before r15-6990-g44d21551362f90 the code for g() was very branchy and
> > included branches that allocate memory, and so can throw bad_alloc. After
> > that commit, the allocations and exceptional path are gone in g(), but we
> > still have two calls to deallocate with _ZdlPvm (which are unreachable
> > because we don't have anything to deallocate!)
>
> Oh actually, the codegen is identical at -O2 since r15-6990-g44d21551362f90,
> so it's only at -O1 there's a difference between f() and g().
>
> I don't know if we care about that, or if this can be considered fixed by
> richi's patch.
I took the preprocessed source from GCC 14.3.0 and compiled it with GCC 15.1.0
and at -O1 both f and g are just `return 9`. At least for aarch64 and x86_64.
And yes it looks like -O1 was fixed via r15-6990-g44d21551362f90 too.
So closing as fixed.