https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108181
--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> --- There's a related one with puts (".."); in the switch arms where we could sink the puts call and have the switch compute the address of the string. tree-ssa-sink.cc has code to sink common stores, that could be enhanced to sink common calls reasonably easily.