https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112312
--- Comment #4 from Martin Jambor <jamborm at gcc dot gnu.org> --- It seems this has been fixed in current master (which is to become gcc 14). If my bisecting is correct, it has been fixed by r14-5628-g53ba8d669550d3 (Jan Hubicka: inter-procedural value range propagation). I guess it would be nice to add this testcase to the testsuite, so I'm keeping this bug opened (and on my TODO list).