https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80297
--- Comment #12 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Author: jakub Date: Fri May 5 21:52:00 2017 New Revision: 247697 URL: https://gcc.gnu.org/viewcvs?rev=247697&root=gcc&view=rev Log: Backported from mainline 2017-04-04 Jakub Jelinek <ja...@redhat.com> Richard Biener <rguent...@suse.de> PR c++/80297 * genmatch.c (capture::gen_transform): For GENERIC unshare_expr captures used multiple times, except for the last use. * generic-match-head.c: Include gimplify.h. * g++.dg/torture/pr80297.C: New test. Added: branches/gcc-6-branch/gcc/testsuite/g++.dg/torture/pr80297.C Modified: branches/gcc-6-branch/gcc/ChangeLog branches/gcc-6-branch/gcc/generic-match-head.c branches/gcc-6-branch/gcc/genmatch.c branches/gcc-6-branch/gcc/testsuite/ChangeLog