You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Without 'link to binary' output flag the code is correct -- the call_cold<>() instance contains RDTSC instruction (with all expected calculations). However with linking to binary the instruction is dropped:
call_cold<main::{lambda()#1}>(main::{lambda()#1}&&) [clone .constprop.0]::
mov %rax,0x2f00(%rip) # 404030 <tsc>
ret
I checked on my local compiler 12.2.1 -- objdump -dC a.out gives expected code (with RDTSC) so it doesn't seem like a compiler issue.
Actually, it might be just cutting off the beginning of the function as the function address is expected to be aligned while the first instruction in the function which I can see is 401129.
Steps to reproduce
Copy-paste the snippet to the godbolt editor
Select g++ 12.2 for x86_64
Make sure the "link-to-binary" flag is chosen
Inspect the assembler output for function call_cold<main::{lambda()#1}>(main::{lambda()#1}&&) [clone .constprop.0] -- for me is shows only the above 2 instructions (mov + ret)
Describe the bug
_rdtsc()
intrinsic somehow get dropped at linkage. Sample:Without 'link to binary' output flag the code is correct -- the
call_cold<>()
instance contains RDTSC instruction (with all expected calculations). However with linking to binary the instruction is dropped:I checked on my local compiler 12.2.1 --
objdump -dC a.out
gives expected code (with RDTSC) so it doesn't seem like a compiler issue.Actually, it might be just cutting off the beginning of the function as the function address is expected to be aligned while the first instruction in the function which I can see is 401129.
Steps to reproduce
call_cold<main::{lambda()#1}>(main::{lambda()#1}&&) [clone .constprop.0]
-- for me is shows only the above 2 instructions (mov
+ret
)Expected behavior
Reproduction link
https://godbolt.org/z/xPe6s597e
Screenshots
Not applicable
Operating System
Manjaro Linux
Browser version
Firefox 110.0 (64-bit)
The text was updated successfully, but these errors were encountered: