[gcc r16-1292] [AutoFDO][testsuite] Enable clone-merge-1.c only for fauto-profile
Kugan Vivekanandarajah
kugan@gcc.gnu.org
Sun Jun 8 23:41:23 GMT 2025
https://gcc.gnu.org/g:df94fb81e76ca26244ff86bf21871e2887040cff
commit r16-1292-gdf94fb81e76ca26244ff86bf21871e2887040cff
Author: Kugan Vivekanandarajah <kvivekananda@nvidia.com>
Date: Mon Jun 9 09:39:35 2025 +1000
[AutoFDO][testsuite] Enable clone-merge-1.c only for fauto-profile
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>
Diff:
---
gcc/auto-profile.cc | 6 +++---
gcc/testsuite/gcc.dg/tree-prof/clone-merge-1.c | 2 ++
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/gcc/auto-profile.cc b/gcc/auto-profile.cc
index 8940d1f28253..e12b3048f20e 100644
--- a/gcc/auto-profile.cc
+++ b/gcc/auto-profile.cc
@@ -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
diff --git a/gcc/testsuite/gcc.dg/tree-prof/clone-merge-1.c b/gcc/testsuite/gcc.dg/tree-prof/clone-merge-1.c
index 40aab9fdfca3..e8e4957e88c7 100644
--- a/gcc/testsuite/gcc.dg/tree-prof/clone-merge-1.c
+++ b/gcc/testsuite/gcc.dg/tree-prof/clone-merge-1.c
@@ -1,4 +1,6 @@
/* { dg-options "-O3 -fno-early-inlining -fdump-ipa-afdo-all" } */
+/* { dg-require-profiling "-fauto-profile" } */
+
__attribute__ ((used))
int a[1000];
More information about the Gcc-cvs
mailing list