On 2022/07/07 23:46, Jeff Law wrote: > This is an update to a patch originally posted by Takayuki Suwa a few months > ago. > > When we initialize an array from a STRING_CST we perform the initialization > in two steps. The first step copies the STRING_CST to the destination. The > second step uses clear_storage to initialize storage in the array beyond > TREE_STRING_LENGTH of the initializer. > > Takayuki's patch added a special case when the STRING_CST itself was all > zeros which would avoid the copy from the STRING_CST and instead do all the > initialization via clear_storage which is clearly more runtime efficient.
Thank you for understanding what I mean... > Richie had the suggestion that instead of special casing when the entire > STRING_CST was NULs to instead identify when the tail of the STRING_CST was > NULs. That's more general and handles Takayuki's case as well. and offering good explanation. > Bootstrapped and regression tested on x86_64-linux-gnu. Given I rewrote > Takayuki's patch I think it needs someone else to review rather than > self-approving. LGTM and of course it resolves the beginning of the first place (https://gcc.gnu.org/pipermail/gcc-patches/2022-May/595685.html). > > OK for the trunk? > > Jeff >