[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>
This commit is contained in:
Kugan Vivekanandarajah
2025-06-09 09:39:35 +10:00
parent fd04219209
commit df94fb81e7
2 changed files with 5 additions and 3 deletions

View 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

View 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];