Issue 131155
Summary PGO fails with "cannot guarantee tail call due to mismatched varargs"
Labels new issue
Assignees
Reporter akaStiX
    When compiling Unreal Engine based project with PGO we get this error:
`cannot guarantee tail call due to mismatched varargs
  musttail call void @"?TimerUpdate@UDataRegistry@@MEAAXXZ"(ptr noundef %0, ...) #51, !dbg !44172
LLVM ERROR: Broken module found, compilation aborted!
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Exception Code: 0xC000001D
 #0 0x00007ff79d18f7f6 xmlLinkGetData (d:\build\AutoSDK\Sync\HostWin64\Win64\LLVM\18.1.8\bin\lld-link.exe+0x210f7f6)
 #1 0x00007ffe29b3bab4 (C:\Windows\System32\ucrtbase.dll+0x7bab4)
 #2 0x00007ffe29b3ca81 (C:\Windows\System32\ucrtbase.dll+0x7ca81)
 #3 0x00007ff79d191c95 xmlLinkGetData (d:\build\AutoSDK\Sync\HostWin64\Win64\LLVM\18.1.8\bin\lld-link.exe+0x2111c95)
 #4 0x00007ff79d0ff7a4 xmlLinkGetData (d:\build\AutoSDK\Sync\HostWin64\Win64\LLVM\18.1.8\bin\lld-link.exe+0x207f7a4)
 #5 0x00007ff79d2bbf6c xmlLinkGetData (d:\build\AutoSDK\Sync\HostWin64\Win64\LLVM\18.1.8\bin\lld-link.exe+0x223bf6c)
 #6 0x00007ff79d26324a xmlLinkGetData (d:\build\AutoSDK\Sync\HostWin64\Win64\LLVM\18.1.8\bin\lld-link.exe+0x21e324a)
 #7 0x00007ff79d29b199 xmlLinkGetData (d:\build\AutoSDK\Sync\HostWin64\Win64\LLVM\18.1.8\bin\lld-link.exe+0x221b199)
 #8 0x00007ff79d25c828 xmlLinkGetData (d:\build\AutoSDK\Sync\HostWin64\Win64\LLVM\18.1.8\bin\lld-link.exe+0x21dc828)
 #9 0x00007ff79d25fb72 xmlLinkGetData (d:\build\AutoSDK\Sync\HostWin64\Win64\LLVM\18.1.8\bin\lld-link.exe+0x21dfb72)
#10 0x00007ff79d1dfb6a xmlLinkGetData (d:\build\AutoSDK\Sync\HostWin64\Win64\LLVM\18.1.8\bin\lld-link.exe+0x215fb6a)
#11 0x00007ff79d1df1f3 xmlLinkGetData (d:\build\AutoSDK\Sync\HostWin64\Win64\LLVM\18.1.8\bin\lld-link.exe+0x215f1f3)
#12 0x00007ff79d1dec66 xmlLinkGetData (d:\build\AutoSDK\Sync\HostWin64\Win64\LLVM\18.1.8\bin\lld-link.exe+0x215ec66)
#13 0x00007ff79d358a0e xmlLinkGetData (d:\build\AutoSDK\Sync\HostWin64\Win64\LLVM\18.1.8\bin\lld-link.exe+0x22d8a0e)
#14 0x00007ff79d358e91 xmlLinkGetData (d:\build\AutoSDK\Sync\HostWin64\Win64\LLVM\18.1.8\bin\lld-link.exe+0x22d8e91)
#15 0x00007ffe29ae6b4c (C:\Windows\System32\ucrtbase.dll+0x26b4c)
#16 0x00007ffe2b284de0 (C:\Windows\System32\KERNEL32.DLL+0x14de0)
#17 0x00007ffe2c2dec4b (C:\Windows\SYSTEM32\ntdll.dll+0x7ec4b)`

Here's the code:
`
class UDataRegistry : public UObject
{
	virtual void TimerUpdate();
}

class UDataRegistrySource : public UObject
{
	virtual void TimerUpdate();
}

void UDataRegistry::TimerUpdate()
{
	float CurrentTime = GetCurrentTime();

	for (int32 i = 0; i < RuntimeSources.Num(); i++)
	{
		UDataRegistrySource* Source = RuntimeSources[i];
		if (Source)
		{
			Source->TimerUpdate(CurrentTime, TimerUpdateFrequency);
		}
	}
}`

Renaming UDataRegistry::TimerUpdate() to something else fixes the issue
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to