https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109442
--- Comment #36 from Richard Biener <rguenth at gcc dot gnu.org> --- I believe strlen_pass::handle_builtin_memcmp should eventually move to forwprop (fold_stmt may not inspect immediate uses). That would help this particular case. Note that in general value-numbering could be improved to handle some memory builtins - we now have robust infrastructure to query known bytes for a memory area (even if only sparse). The question is whether it's worth the cost of course - the examples look quite artificial.