From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2140) id 593D73850434; Sat, 10 Jul 2021 09:44:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 593D73850434 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Alexandre Oliva To: gcc-cvs@gcc.gnu.org Subject: [gcc(refs/users/aoliva/heads/testme)] sync up new type indices for body adjustments X-Act-Checkin: gcc X-Git-Author: Alexandre Oliva X-Git-Refname: refs/users/aoliva/heads/testme X-Git-Oldrev: 7a0d3299c7af17c36d533ed2e476c110bcfbd424 X-Git-Newrev: 4f317ad5a50676617bbafcba43b340af44207410 Message-Id: <20210710094400.593D73850434@sourceware.org> Date: Sat, 10 Jul 2021 09:44:00 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Jul 2021 09:44:00 -0000 https://gcc.gnu.org/g:4f317ad5a50676617bbafcba43b340af44207410 commit 4f317ad5a50676617bbafcba43b340af44207410 Author: Alexandre Oliva Date: Fri Jul 9 19:54:46 2021 -0300 sync up new type indices for body adjustments Diff: --- gcc/ipa-param-manipulation.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/gcc/ipa-param-manipulation.c b/gcc/ipa-param-manipulation.c index 75b5a47a7ae..dbbe547832d 100644 --- a/gcc/ipa-param-manipulation.c +++ b/gcc/ipa-param-manipulation.c @@ -1102,11 +1102,17 @@ ipa_param_body_adjustments::common_initialization (tree old_fndecl, corresponding m_id->dst_node->clone.performed_splits entries. */ m_new_decls.reserve_exact (adj_len); - for (unsigned i = 0; i < adj_len ; i++) + for (unsigned i = 0, nti = 0; i < adj_len ; i++, nti++) { ipa_adjusted_param *apm = &(*m_adj_params)[i]; unsigned prev_index = apm->prev_clone_index; tree new_parm; + if (apm->op == IPA_PARAM_OP_COPY + && prev_index >= otypes.length ()) + /* Keep nti in sync with the m_new_types indices used in + fill_vector_of_new_param_types, for any non-IPA_PARAM_OP_COPY + parms. */ + nti--; if (apm->op == IPA_PARAM_OP_COPY || apm->prev_clone_adjustment) { @@ -1117,7 +1123,7 @@ ipa_param_body_adjustments::common_initialization (tree old_fndecl, else if (apm->op == IPA_PARAM_OP_NEW || apm->op == IPA_PARAM_OP_SPLIT) { - tree new_type = m_new_types[i]; + tree new_type = m_new_types[nti]; gcc_checking_assert (new_type); new_parm = build_decl (UNKNOWN_LOCATION, PARM_DECL, NULL_TREE, new_type);