]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[AutoFDO][testsuite] Enable clone-merge-1.c only for fauto-profile
authorKugan Vivekanandarajah <kvivekananda@nvidia.com>
Sun, 8 Jun 2025 23:39:35 +0000 (09:39 +1000)
committerKugan Vivekanandarajah <kvivekananda@nvidia.com>
Sun, 8 Jun 2025 23:40:48 +0000 (09:40 +1000)
This patch enables clone-merge-1.c only for fauto-profile as it is
failing otherwise. This also fixes a yupo in merge.

gcc/testsuite/ChangeLog:

* gcc.dg/tree-prof/clone-merge-1.c: Enable only for
-fauto-profile.

gcc/ChangeLog:

* auto-profile.cc (function_instance::merge): Fix typo.

Signed-off-by: Kugan Vivekanandarajah <kvivekananda@nvidia.com>
gcc/auto-profile.cc
gcc/testsuite/gcc.dg/tree-prof/clone-merge-1.c

index 8940d1f28253039431b0fc96a8d77703c42b4f6e..e12b3048f20e8483110a1c27b561dc4f9d4c7f4e 100644 (file)
@@ -575,10 +575,10 @@ void function_instance::merge (function_instance *other)
   for (callsite_map::const_iterator iter = other->callsites.begin ();
        iter != other->callsites.end (); ++iter)
     if (callsites.count (iter->first) == 0)
-       callsites[iter->first] = iter->second;
+      callsites[iter->first] = iter->second;
 
-  for (position_count_map::const_iterator iter = pos_counts.begin ();
-       iter != pos_counts.end (); ++iter)
+  for (position_count_map::const_iterator iter = other->pos_counts.begin ();
+       iter != other->pos_counts.end (); ++iter)
     if (pos_counts.count (iter->first) == 0)
       pos_counts[iter->first] = iter->second;
     else
index 40aab9fdfca3e7a0f13ba2f2f9d9ec86ba23b4bf..e8e4957e88c7710cf755ab20a2e0d9293707a8c7 100644 (file)
@@ -1,4 +1,6 @@
 /* { dg-options "-O3 -fno-early-inlining -fdump-ipa-afdo-all" } */
+/* { dg-require-profiling "-fauto-profile" } */ 
+
 __attribute__ ((used))
 int a[1000];