[AutoFDO] fix AutoFDO inlined target matching

Message ID 20260804002845.89572-1-kvivekananda@nvidia.com
State New
Headers
Series [AutoFDO] fix AutoFDO inlined target matching |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gcc_build--master-arm success Build passed
linaro-tcwg-bot/tcwg_simplebootstrap_build--master-arm-bootstrap success Build passed
linaro-tcwg-bot/tcwg_gcc_check--master-arm success Test passed

Commit Message

Kugan Vivekanandarajah Aug. 4, 2026, 12:28 a.m. UTC
  This fixes a typo. The symbol-name comparison loop never executed because
its condition was the loop index itself.  Compare matching characters
until either name ends so stripped clone suffixes can be recognized.

gcc/ChangeLog:

	* auto-profile.cc (match_with_target): Fix the symbol-name comparison
	loop.

Regression tested on aarch64-linux-gnu with no new regressions

Signed-off-by: Kugan Vivekanandarajah <kvivekananda@nvidia.com>
---
 gcc/auto-profile.cc | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
  

Patch

diff --git a/gcc/auto-profile.cc b/gcc/auto-profile.cc
index f4562d7f2f98..ca83bca40726 100644
--- a/gcc/auto-profile.cc
+++ b/gcc/auto-profile.cc
@@ -1572,10 +1572,8 @@  match_with_target (cgraph_node *n,
     {
       int i;
       bool in_suffix = false;
-      for (i = 0; i; i++)
+      for (i = 0; name[i] && name[i] == symbol_name[i]; i++)
 	{
-	  if (name[i] != symbol_name[i])
-	    break;
 	  if (name[i] == '.')
 	    in_suffix = true;
 	}