<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/146152>146152</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[AArch64] reference to _fltused not generated for floating point code on aarch64-pc-windows-msvc target
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
AdamGlass
</td>
</tr>
</table>
<pre>
There has been some confusion about whether a reference to _fltused should be generated on windows-msvc targets on architectures other than x86/x64 when compiling code with float types/values. I've talked to the MSVC team and have confirmed that the _fltused reference is generated on all architectures to trigger the initialization of some parts of the CRT.
Using this sample code:
float square(float num) {
return num * num;
}
I've verified these scenarios
MSVC x64 v19 latest - EXTRN _fltused:DWORD
MSVC x64 v192.0 VS16 - EXTRN _fltused:DWORD
MSVC x86 v19 latest - EXTRN __fltused:DWORD
MSVC ARM64 v19.latest - IMPORT |_fltused|
MSVC ARM v19 something -IMPORT |_fltused|
Clang 20.1.0 -target -target x86_64-pc-windows-msvc - .globl _fltused
Clang Trunk -target -target x86_64-pc-windows-msvc - .globl _fltused
Clang Trunk -target aarch64-pc-windows-msvc - <NOTHING>
The net is that Clang does the wrong thing on the aarch64-pc-windows-msvc target.
This was a question raised in this PR but not resolved: https://github.com/llvm/llvm-project/pull/100368
Intend to bring a PR to fix this issue.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJy0VEGTmzgT_TXypcuUEAbsAwdix_nmMDMpx192bykBDdJGSI4k8GR__ZaEM5Nkd7Z2D3uikLpf93v91Nw5OWjEiuRvSH5Y8ckLY6u64-M7xZ1bNab7WhFanwVaBMEdNIganBkRWqP7yUmjgTdm8nAV6AVa4GCxR4u6RfAGPvXKTw47cMJMqoMGYUCNlnvswGi4St2Zq1uPbm7Bczugd-Gc21ZIj62fLDowEdoLruFpWxB2fCo2oaKG1owXqaQeoDUdwlV6Ab0y3IP_ekFH2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