https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108115
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Last reconfirmed| |2022-12-15 Status|RESOLVED |NEW Resolution|DUPLICATE |--- Ever confirmed|0 |1 See Also| |https://gcc.gnu.org/bugzill | |a/show_bug.cgi?id=106119 --- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Maybe not exactly a dup. But what is happening is we are sinking the cast to the conditional which moves it across the free. But definitely related to PR 106119 and PR 104215 .