Re: [PATCH] c++: quadratic constexpr behavior for left-assoc logical exprs [PR102780]

2021-11-01 Thread Patrick Palka via Gcc-patches
On Mon, 1 Nov 2021, Patrick Palka wrote: > On Fri, 29 Oct 2021, Jakub Jelinek wrote: > > > On Thu, Oct 28, 2021 at 03:35:20PM -0400, Patrick Palka wrote: > > > > Is there a reason to turn this mode of evaluating everything twice if an > > > > error should be diagnosed all the time, rather than on

Re: [PATCH] c++: quadratic constexpr behavior for left-assoc logical exprs [PR102780]

2021-11-01 Thread Patrick Palka via Gcc-patches
On Fri, 29 Oct 2021, Jakub Jelinek wrote: > On Thu, Oct 28, 2021 at 03:35:20PM -0400, Patrick Palka wrote: > > > Is there a reason to turn this mode of evaluating everything twice if an > > > error should be diagnosed all the time, rather than only if we actually > > > see > > > a TRUTH_*_EXPR we

Re: [PATCH] c++: quadratic constexpr behavior for left-assoc logical exprs [PR102780]

2021-10-29 Thread Jakub Jelinek via Gcc-patches
On Thu, Oct 28, 2021 at 03:35:20PM -0400, Patrick Palka wrote: > > Is there a reason to turn this mode of evaluating everything twice if an > > error should be diagnosed all the time, rather than only if we actually see > > a TRUTH_*_EXPR we want to handle this way? > > If we don't see any TRUTH_*_

Re: [PATCH] c++: quadratic constexpr behavior for left-assoc logical exprs [PR102780]

2021-10-28 Thread Patrick Palka via Gcc-patches
On Thu, 28 Oct 2021, Jakub Jelinek wrote: > On Thu, Oct 28, 2021 at 12:40:02PM -0400, Patrick Palka wrote: > > PR c++/102780 > > > > gcc/cp/ChangeLog: > > > > * constexpr.c (potential_constant_expression_1) : > > When tf_error isn't set, preemptively check potentiality of the > >

Re: [PATCH] c++: quadratic constexpr behavior for left-assoc logical exprs [PR102780]

2021-10-28 Thread Jakub Jelinek via Gcc-patches
On Thu, Oct 28, 2021 at 12:40:02PM -0400, Patrick Palka wrote: > PR c++/102780 > > gcc/cp/ChangeLog: > > * constexpr.c (potential_constant_expression_1) : > When tf_error isn't set, preemptively check potentiality of the > second operand before performing trial evaluation

Re: [PATCH] c++: quadratic constexpr behavior for left-assoc logical exprs [PR102780]

2021-10-28 Thread Patrick Palka via Gcc-patches
> On 10/27/21 17:10, Patrick Palka wrote: > > On Wed, 27 Oct 2021, Jason Merrill wrote: > > > > > On 10/27/21 14:54, Patrick Palka wrote: > > > > On Tue, 26 Oct 2021, Jakub Jelinek wrote: > > > > > > > > > On Tue, Oct 26, 2021 at 05:07:43PM -0400, Patrick Palka wrote: > > > > > > The performance

Re: [PATCH] c++: quadratic constexpr behavior for left-assoc logical exprs [PR102780]

2021-10-27 Thread Jason Merrill via Gcc-patches
On 10/27/21 17:10, Patrick Palka wrote: On Wed, 27 Oct 2021, Jason Merrill wrote: On 10/27/21 14:54, Patrick Palka wrote: On Tue, 26 Oct 2021, Jakub Jelinek wrote: On Tue, Oct 26, 2021 at 05:07:43PM -0400, Patrick Palka wrote: The performance impact of the other calls to cxx_eval_outermost_

Re: [PATCH] c++: quadratic constexpr behavior for left-assoc logical exprs [PR102780]

2021-10-27 Thread Patrick Palka via Gcc-patches
On Wed, 27 Oct 2021, Jason Merrill wrote: > On 10/27/21 14:54, Patrick Palka wrote: > > On Tue, 26 Oct 2021, Jakub Jelinek wrote: > > > > > On Tue, Oct 26, 2021 at 05:07:43PM -0400, Patrick Palka wrote: > > > > The performance impact of the other calls to > > > > cxx_eval_outermost_const_expr > >

Re: [PATCH] c++: quadratic constexpr behavior for left-assoc logical exprs [PR102780]

2021-10-27 Thread Jason Merrill via Gcc-patches
On 10/27/21 14:54, Patrick Palka wrote: On Tue, 26 Oct 2021, Jakub Jelinek wrote: On Tue, Oct 26, 2021 at 05:07:43PM -0400, Patrick Palka wrote: The performance impact of the other calls to cxx_eval_outermost_const_expr from p_c_e_1 is probably already mostly mitigated by the constexpr call ca

Re: [PATCH] c++: quadratic constexpr behavior for left-assoc logical exprs [PR102780]

2021-10-27 Thread Patrick Palka via Gcc-patches
On Tue, 26 Oct 2021, Jakub Jelinek wrote: > On Tue, Oct 26, 2021 at 05:07:43PM -0400, Patrick Palka wrote: > > The performance impact of the other calls to cxx_eval_outermost_const_expr > > from p_c_e_1 is probably already mostly mitigated by the constexpr call > > cache and the fact that we try t

Re: [PATCH] c++: quadratic constexpr behavior for left-assoc logical exprs [PR102780]

2021-10-26 Thread Jakub Jelinek via Gcc-patches
On Tue, Oct 26, 2021 at 05:07:43PM -0400, Patrick Palka wrote: > The performance impact of the other calls to cxx_eval_outermost_const_expr > from p_c_e_1 is probably already mostly mitigated by the constexpr call > cache and the fact that we try to evaluate all calls to constexpr > functions durin

Re: [PATCH] c++: quadratic constexpr behavior for left-assoc logical exprs [PR102780]

2021-10-26 Thread Patrick Palka via Gcc-patches
On Tue, 26 Oct 2021, Jason Merrill wrote: > On Tue, Oct 26, 2021 at 2:46 PM Jakub Jelinek via Gcc-patches > wrote: > On Tue, Oct 26, 2021 at 01:44:18PM -0400, Patrick Palka via Gcc-patches > wrote: > > In the testcase below the two left fold expressions each expand into a > >

Re: [PATCH] c++: quadratic constexpr behavior for left-assoc logical exprs [PR102780]

2021-10-26 Thread Jakub Jelinek via Gcc-patches
On Tue, Oct 26, 2021 at 03:29:02PM -0400, Jason Merrill wrote: > On Tue, Oct 26, 2021 at 2:46 PM Jakub Jelinek via Gcc-patches < > gcc-patches@gcc.gnu.org> wrote: > > > On Tue, Oct 26, 2021 at 01:44:18PM -0400, Patrick Palka via Gcc-patches > > wrote: > > > In the testcase below the two left fold

Re: [PATCH] c++: quadratic constexpr behavior for left-assoc logical exprs [PR102780]

2021-10-26 Thread Jason Merrill via Gcc-patches
On Tue, Oct 26, 2021 at 2:46 PM Jakub Jelinek via Gcc-patches < gcc-patches@gcc.gnu.org> wrote: > On Tue, Oct 26, 2021 at 01:44:18PM -0400, Patrick Palka via Gcc-patches > wrote: > > In the testcase below the two left fold expressions each expand into a > > logical expression with 1024 terms, for

Re: [PATCH] c++: quadratic constexpr behavior for left-assoc logical exprs [PR102780]

2021-10-26 Thread Jakub Jelinek via Gcc-patches
On Tue, Oct 26, 2021 at 01:44:18PM -0400, Patrick Palka via Gcc-patches wrote: > In the testcase below the two left fold expressions each expand into a > logical expression with 1024 terms, for which potential_const_expr_1 > takes more than a minute to return true. This is because p_c_e_1 > perfor