Re: [PATCH] c++: decl_constant_value and unsharing [PR96197]

2020-07-31 Thread Jason Merrill via Gcc-patches
think we need the added parameter for scalar_constant_value. Hmm, I guess it should always be cheap to unshare an scalar initializer. So consider the parameter removed for scalar_constant_value. -- >8 -- Subject: [PATCH] c++: decl_constant_value and unsharing [PR96197] In the testcase

Re: [PATCH] c++: decl_constant_value and unsharing [PR96197]

2020-07-30 Thread Richard Biener via Gcc-patches
ee routines that controls unsharing (except for > > > decl_constant_value, which instead needs a new overload if we don't want > > > to touch its common declaration in c-common.h.) Bootstrap and regtest > > > in progress. > > > > That looks good, though

Re: [PATCH] c++: decl_constant_value and unsharing [PR96197]

2020-07-30 Thread Patrick Palka via Gcc-patches
, this patch also moves the call to unshare_expr in > > constant_value_1 outside of the loop, since calling unshare_expr on a > > DECL_P should be a no-op. > > > > Additionally, in unify there is one call to scalar_constant_value that > > seems to be dead code since we ap

Re: [PATCH] c++: decl_constant_value and unsharing [PR96197]

2020-07-30 Thread Jason Merrill via Gcc-patches
don't want to touch its common declaration in c-common.h.) Bootstrap and regtest in progress. That looks good, though I don't think we need the added parameter for scalar_constant_value. -- >8 -- Subject: [PATCH] c++: decl_constant_value and unsharing [PR96197] In the testcase

Re: [PATCH] c++: decl_constant_value and unsharing [PR96197]

2020-07-30 Thread Patrick Palka via Gcc-patches
tines that controls unsharing (except for decl_constant_value, which instead needs a new overload if we don't want to touch its common declaration in c-common.h.) Bootstrap and regtest in progress. -- >8 -- Subject: [PATCH] c++: decl_constant_value and unsharing [PR96197] In the testcase

Re: [PATCH] c++: decl_constant_value and unsharing [PR96197]

2020-07-29 Thread Jason Merrill via Gcc-patches
On 7/21/20 3:07 PM, Patrick Palka wrote: In the testcase from the PR we are seeing excessive memory use (> 5GB) during constexpr evaluation, almost all of which is due to the call to decl_constant_value in the VAR_DECL/CONST_DECL branch of cxx_eval_constant_expression. We reach here every time w

Re: [PATCH] c++: decl_constant_value and unsharing [PR96197]

2020-07-22 Thread Patrick Palka via Gcc-patches
testcase in the PR falls from 5GB to 15MB according to -ftime-report. > > > > Bootstrapped and regtested on x86_64-pc-linux-gnu, and also tested on > > cmcstl2 and a number of other libraries. Does this look OK to commit? > > Can you add the PRs testcase? Thanks for track

Re: [PATCH] c++: decl_constant_value and unsharing [PR96197]

2020-07-21 Thread Richard Biener via Gcc-patches
On Tue, Jul 21, 2020 at 9:08 PM Patrick Palka via Gcc-patches wrote: > > In the testcase from the PR we are seeing excessive memory use (> 5GB) > during constexpr evaluation, almost all of which is due to the call to > decl_constant_value in the VAR_DECL/CONST_DECL branch of > cxx_eval_constant_ex

[PATCH] c++: decl_constant_value and unsharing [PR96197]

2020-07-21 Thread Patrick Palka via Gcc-patches
In the testcase from the PR we are seeing excessive memory use (> 5GB) during constexpr evaluation, almost all of which is due to the call to decl_constant_value in the VAR_DECL/CONST_DECL branch of cxx_eval_constant_expression. We reach here every time we evaluate an ARRAY_REF of a constexpr VAR_