https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105051
--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> --- It's more of a QOI issue, we have similar (old) bugs where we pattern-match a memcpy loop to memcpy inside memcpy (PR56888). The difficulty is to reliably detect whether we're in a place where emitting a call to 'foo' will recurse. Unfortunately the people with knowledge in this area are too busy and given workarounds exist this hasn't been top priority.