The stack-overflow bug you reported <https://bugs.gnu.org/46227> appears
to be fixed on SPARC Solaris 10. Could you please try again on SPARC
Gentoo? You can use the new grep snapshot, announced here:
https://lists.gnu.org/r/grep-devel/2021-08/msg00003.html
Thankss.