https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108340
--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> --- The trunk change caused various regressions and needed multiple follow-ups, I'm afraid it is not a good idea to backport that. r13-2658, r13-2709, r13-2891 at least. Perhaps backporting the 2 match.pd hunks from r13-2658 and nothing else could work for 12.3, provided it fixes the testcases.