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
There appears to be a case that looks like optimisations resulting in bad code to be generated for Android ARM. This issue demonstrates the problem in the context where I ran into it, using the byteorder library.
Test environment
Host OS: OSX 10.9.5
Android SDK
Android NDK (Revision 10d) with standalone toolchain according to the wiki.
Android Emulator: ARM (armeabi-v7a), Android 5.0.1 (API level 21)
rustc 1.0.0-dev (built 2015-02-23), configured for cross-compilation to the arm-linux-androideabi target.
The following is the output for the relevant functions (write_u16, write_u32 and write_u64) of compiling byteorder using --emit=llvm-ir with and without the above patch.
There appears to be a case that looks like optimisations resulting in bad code to be generated for Android ARM. This issue demonstrates the problem in the context where I ran into it, using the byteorder library.
Test environment
arm-linux-androideabitarget.Steps to reproduce
Clone byteorder. Checkout commit
d9259c15a4b18de37d765aebbe5034f282772b84.Create main.rs:
Build
Run on emulator
Output
Expected:
Actual (sample):
Workarounds
There seem to be two ways to work around the problem:
Apply the following patch to
byteorderTurn off optimizations (
opt-level).Further Details
The following is the output for the relevant functions (
write_u16,write_u32andwrite_u64) of compilingbyteorderusing--emit=llvm-irwith and without the above patch.Without the patch: https://gist.github.com/romanb/2ff2ebb474c87103e631
With the patch: https://gist.github.com/romanb/d419ba4882d9c489c494