]> git.ipfire.org Git - thirdparty/gcc.git/commit
Reduce accumulated garbage in constexpr evaluation.
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 4 Jun 2019 14:47:40 +0000 (14:47 +0000)
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 4 Jun 2019 14:47:40 +0000 (14:47 +0000)
commit8a9112cda6b331f0964166d5e726b1d8d98baedc
tree6c44b508c28bc1e7f1f7141324f204af83dcb7f2
parent93e296b8fb232259865548895cf0f8c8f486fc08
Reduce accumulated garbage in constexpr evaluation.

We want to evaluate the arguments to a call before looking into the cache so
that we have constant values, but if we then find the call in the cache we
end up with a TREE_LIST that we don't end up using; in highly recursive
constexpr evaluation this ends up being a large proportion of the garbage
generated.

The cxx_eval_increment_expression hunk is less important, but it's an easy
tweak; we only use the MODIFY_EXPR to evaluate it, so after that it's
garbage.

* constexpr.c (cxx_eval_call_expression): ggc_free any bindings we
don't save.
(cxx_eval_increment_expression): ggc_free the MODIFY_EXPR after
evaluating it.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@271909 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/cp/ChangeLog
gcc/cp/constexpr.c