[Bug c++/112335] missed optimization on reset and assign unique_ptr
redi at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Nov 3 14:23:33 GMT 2023
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112335
--- Comment #10 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Ah, now I understand what you've been saying about the postcondition.
Yes, but the compiler doesn't know the postcondition, it's just words in the
standard, so not visible to the optimization passes.
It might be possible to add some optimization hints to the std::unique_ptr
implementation to make the postcondition visible to the optimizer.
More information about the Gcc-bugs
mailing list