Re: [C++ PATCH] Add -fconstexpr-loop-nest-limit= option (PR c++/87481)

2019-03-08 Thread Richard Biener
On Fri, Mar 8, 2019 at 12:45 PM Jakub Jelinek wrote: > > On Fri, Mar 08, 2019 at 12:25:31PM +0100, Jakub Jelinek wrote: > > Maybe. The question is what exactly should we count. We could count only > > in the cxx_eval_statement_list loop individual non-debug statements, > > but that would miss

Re: [C++ PATCH] Add -fconstexpr-loop-nest-limit= option (PR c++/87481)

2019-03-08 Thread Jakub Jelinek
On Fri, Mar 08, 2019 at 12:25:31PM +0100, Jakub Jelinek wrote: > Maybe. The question is what exactly should we count. We could count only > in the cxx_eval_statement_list loop individual non-debug statements, > but that would miss statements that aren't in STATEMENT_LISTs. > Or we could count

Re: [C++ PATCH] Add -fconstexpr-loop-nest-limit= option (PR c++/87481)

2019-03-08 Thread Jakub Jelinek
On Fri, Mar 08, 2019 at 11:36:36AM +0100, Richard Biener wrote: > Shouldn't we somehow limit the number of stmt evaluations instead? > I can imagine using constexpr templates you can do "loops" easily > without actually writing loops ... Maybe. The question is what exactly should we count. We

Re: [C++ PATCH] Add -fconstexpr-loop-nest-limit= option (PR c++/87481)

2019-03-08 Thread Richard Biener
On Thu, Mar 7, 2019 at 8:22 PM Jakub Jelinek wrote: > > Hi! > > We have -fconstexpr-loop-limit= option to have an upper bound for constexpr > evaluation of a single loop. Even with that limit in place, if we have > several nested loops during constexpr evaluation, even when each could have > a

[C++ PATCH] Add -fconstexpr-loop-nest-limit= option (PR c++/87481)

2019-03-07 Thread Jakub Jelinek
Hi! We have -fconstexpr-loop-limit= option to have an upper bound for constexpr evaluation of a single loop. Even with that limit in place, if we have several nested loops during constexpr evaluation, even when each could have a few hundred iterations, the whole loop nest could take years to