public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/users/aoliva/heads/testme)] sync up new type indices for body adjustments
@ 2021-07-10  0:08 Alexandre Oliva
  0 siblings, 0 replies; 2+ messages in thread
From: Alexandre Oliva @ 2021-07-10  0:08 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:dd3a7aa46dc4307b9eb93a21f6a792f69aef313d

commit dd3a7aa46dc4307b9eb93a21f6a792f69aef313d
Author: Alexandre Oliva <oliva@adacore.com>
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);


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [gcc(refs/users/aoliva/heads/testme)] sync up new type indices for body adjustments
@ 2021-07-10  9:44 Alexandre Oliva
  0 siblings, 0 replies; 2+ messages in thread
From: Alexandre Oliva @ 2021-07-10  9:44 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:4f317ad5a50676617bbafcba43b340af44207410

commit 4f317ad5a50676617bbafcba43b340af44207410
Author: Alexandre Oliva <oliva@adacore.com>
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);


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-07-10  9:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-10  0:08 [gcc(refs/users/aoliva/heads/testme)] sync up new type indices for body adjustments Alexandre Oliva
2021-07-10  9:44 Alexandre Oliva

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).