https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110394
--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> --- You can also try -fno-lifetime-dse to see if you get the behavior you were expecting too. Though I am not sure it will help extend the lifetime of the temporary here ... https://gcc.gnu.org/onlinedocs/gcc-13.1.0/gcc/Optimize-Options.html#index-flifetime-dse