On 3/25/19 5:28 AM, Paolo Carlini wrote:
Hi,

a while ago I noticed that in cp_parser_binary_expression we were calling cp_fully_fold first to disable the warnings for not executed expressions, and then, seemingly in a very redundant and inconsistent with other situations way, to re-enable the warnings (*). Thus, I meant to investigate opportunities for a mini optimization / clean-up during the next Stage 1.

However, over the last couple of weeks I noticed that we had in Bugzilla a number of error-recovery regressions happening starting from the *second* cp_fully_fold calls, those which likely could be completely avoided. Note, not only we were calling again cp_fully_fold, we were also doing that for expressions which could not be folded to true/false the first time we tried, error-prone and wasteful too.

Then the below which seems rather straightforward to me. To be super-safe I carried out a number of additional checks and instrumented testsuite runs: that we exercise the code enough; that when we set disable_warnings_sp = sp we find it NULL, etc. Everything went well..

Tested x86_64-linux.

Thanks, Paolo.

(*) Historically, we used not to have this disabling code at all, then a very basic version not folding.

/////////////////



OK.

Jason

Reply via email to