https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120029
--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> --- No, I don't think we need to care about the performance of this case. It's not a realistic operation that is commonly needed for paths.