From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2122) id 838EA3858433; Tue, 1 Nov 2022 01:23:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 838EA3858433 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1667265837; bh=FXH/t3011SHHQld0YikxFNmEnMdk+MInLniq95Gsf6U=; h=From:To:Subject:Date:From; b=XXFXHGyi/RyUlTHyzwCND6Ii85skHnScEzGQu7eMGgSVxzJGKZMXjbScKtH73tr+v WjJqwSxXFw0Oy/NajMLVWsY96YO2GX4T/QYHg23WT7F6GORgO5IO18oYT2Lggv8X1p vnJHBD4P9ajdlOY3oVdzklZl47PMaiB7dNnq3wUE= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Jason Merrill To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-3584] c++: set TREE_NOTHROW after genericize X-Act-Checkin: gcc X-Git-Author: Jason Merrill X-Git-Refname: refs/heads/master X-Git-Oldrev: 6a1f27f45e44bcfbcc06a1aad74bb076e56eda36 X-Git-Newrev: 43c40f114a68edc9a9cc9963dc940c11806ff863 Message-Id: <20221101012357.838EA3858433@sourceware.org> Date: Tue, 1 Nov 2022 01:23:54 +0000 (GMT) List-Id: https://gcc.gnu.org/g:43c40f114a68edc9a9cc9963dc940c11806ff863 commit r13-3584-g43c40f114a68edc9a9cc9963dc940c11806ff863 Author: Jason Merrill Date: Mon Oct 31 13:38:41 2022 -0400 c++: set TREE_NOTHROW after genericize genericize might introduce function calls (and does on the contracts branch), so it's safer to set this flag later. gcc/cp/ChangeLog: * decl.cc (finish_function): Set TREE_NOTHROW later in the function. Diff: --- gcc/cp/decl.cc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/gcc/cp/decl.cc b/gcc/cp/decl.cc index 87cb7a6c3a4..6e98ea35a39 100644 --- a/gcc/cp/decl.cc +++ b/gcc/cp/decl.cc @@ -17867,14 +17867,6 @@ finish_function (bool inline_p) finish_fname_decls (); - /* If this function can't throw any exceptions, remember that. */ - if (!processing_template_decl - && !cp_function_chain->can_throw - && !flag_non_call_exceptions - && !decl_replaceable_p (fndecl, - opt_for_fn (fndecl, flag_semantic_interposition))) - TREE_NOTHROW (fndecl) = 1; - /* This must come after expand_function_end because cleanups might have declarations (from inline functions) that need to go into this function's blocks. */ @@ -18099,6 +18091,14 @@ finish_function (bool inline_p) && !DECL_OMP_DECLARE_REDUCTION_P (fndecl)) cp_genericize (fndecl); + /* If this function can't throw any exceptions, remember that. */ + if (!processing_template_decl + && !cp_function_chain->can_throw + && !flag_non_call_exceptions + && !decl_replaceable_p (fndecl, + opt_for_fn (fndecl, flag_semantic_interposition))) + TREE_NOTHROW (fndecl) = 1; + /* Emit the resumer and destroyer functions now, providing that we have not encountered some fatal error. */ if (coro_emit_helpers)