https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78629
--- Comment #1 from prathamesh3492 at gcc dot gnu.org --- This slight change to finish_match_operand() fixes the error, but not sure if it's correct. diff --git a/gcc/genmatch.c b/gcc/genmatch.c index 41951c5..3ff5bdf 100644 --- a/gcc/genmatch.c +++ b/gcc/genmatch.c @@ -4798,7 +4798,10 @@ parser::finish_match_operand (operand *op) /* Look for matching captures, diagnose mis-uses of @@ and apply early lowering and distribution of value_match. */ auto_vec<vec<capture *> > cpts; - cpts.safe_grow_cleared (capture_ids->elements ()); + cpts.reserve (capture_ids->elements ()); + for (unsigned i = 0; i < capture_ids->elements (); ++i) + cpts.quick_push (vNULL); + walk_captures (op, cpts); for (unsigned i = 0; i < cpts.length (); ++i) { Thanks, Prathamesh