https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87228
Jonathan Wakely <redi at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2018-09-05 Ever confirmed|0 |1 --- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> --- If the widening, grouping and padding was done in one pass it would only need two allocations (one for the narrow character string and one for the wide character result). That would reduce the memory usage and reduce the number of times the buffers are copied.