]> git.lizzy.rs Git - rust.git/commit
trans: Call `fmod` manually for 32-bit float rem
authorAlex Crichton <alex@alexcrichton.com>
Tue, 18 Aug 2015 00:00:45 +0000 (17:00 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Tue, 18 Aug 2015 06:32:30 +0000 (23:32 -0700)
commit8a7b0fad531f2cbb40aace2bdfb5f03060a61d33
tree99e9e41afaf66e95fcd789d1da50ef83de859b6e
parent47ea0cfb6bd250c970e3a61d62bfa1b1c7bb27d4
trans: Call `fmod` manually for 32-bit float rem

Currently `f32 % f32` will generate a link error on 32-bit MSVC because LLVM
will lower the operation to a call to the nonexistent function `fmodf`. Work
around in this in the backend by lowering to a call to `fmod` instead with
necessary extension/truncation between floats/doubles.

Closes #27859
src/librustc_trans/trans/expr.rs
src/test/run-pass/issue-27859.rs [new file with mode: 0644]