-
Notifications
You must be signed in to change notification settings - Fork 15.3k
Description
| Bugzilla Link | 11453 |
| Resolution | INVALID |
| Resolved on | Jan 27, 2014 16:08 |
| Version | trunk |
| OS | Linux |
| Attachments | Test program to reproduce the bug, Test program llvm/llvm-project#374 to reproduce the bug |
| Reporter | LLVM Bugzilla Contributor |
| CC | @zygoloid |
Extended Description
-
On ARM, the output of the attached programs is:
Min is negative
Min is negative
Min is negative
Min is negative -
But if "-O2" is used, on ARM the binary generates different results:
Min is negative
Min is negative
Min is negative
Min is NOT negative
To reproduce "1" above, please do:
A. cpp to ll
~/llvmUpstream/Release+Asserts/bin/clang -o lib.ll -S -emit-llvm lib.cpp
B. ll to bc
~/llvmUpstream/Release+Asserts/bin/llvm-as -o=lib.bc lib.ll
C. bc to o
~/llvmUpstream/Release+Asserts/bin/llc -relocation-model=pic -o=lib.o -filetype=obj -mtriple=armv7-none-linux-gnueabi -mattr=+v7 -float-abi=soft ./lib.bc
D. o to so
/Android/prebuilt/linux-x86/toolchain/arm-linux-androideabi-4.4.x/bin/arm-linux-androideabi-ld -soname libtest.so -L /Android/out/target/product/maguro/system/lib -freloc=PIC -o ./libtest.so ./lib.o ~/Android/prebuilt/linux-x86/toolchain/arm-linux-androideabi-4.4.x/lib/gcc/arm-linux-androideabi/4.4.3/libgcc.a/Android/out/target/product/maguro/system/lib -lc -shared --no-undefined --fix-cortex-a8 -rpath-link=/Android/out/target/product/maguro/system/lib -rpath=
To reproduce "2" above, please insert Step B1 and B2 while issuing the commands A-D above.
B1. Use opt with -O2. bc to bc.
~/llvmUpstream/Release+Asserts/bin/opt -o=lib.opt.bc -O2 lib.bc
B2. mv lib.opt.bc lib.bc