https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70452
--- Comment #12 from Patrick Palka <ppalka at gcc dot gnu.org> --- Turns out that a single line of code is responsible for the 50MB increase in memory usage relative to 4.9, and that's the call to unshare_expr in cxx_eval_call_expression: /* Associate the bindings with the remapped parms. */ tree bound = new_call.bindings; tree remapped = parms; while (bound) { tree oparm = TREE_PURPOSE (bound); tree arg = TREE_VALUE (bound); gcc_assert (DECL_NAME (remapped) == DECL_NAME (oparm)); /* Don't share a CONSTRUCTOR that might be changed. */ arg = unshare_expr (arg); // <------- ctx->values->put (remapped, arg); bound = TREE_CHAIN (bound); remapped = DECL_CHAIN (remapped); } We unshare each function argument unconditionally even though it's only necessary to do so for CONSTRUCTORs. This apparently creates a lot of garbage. I wonder if guarding the unsharing with "TREE_CODE (arg) == CONSTRUCTOR" would be sufficient?