[LLVMbugs] [Bug 11453] New: opt -O2 generates different results

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Nov 29 13:46:07 CST 2011


http://llvm.org/bugs/show_bug.cgi?id=11453

             Bug #: 11453
           Summary: opt -O2 generates different results
           Product: libraries
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Scalar Optimizations
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: sliao at google.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


1. On ARM, the output of the attached programs is:
  Min is negative
  Min is negative
  Min is negative
  Min is negative

2. 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 -lc
-shared --no-undefined --fix-cortex-a8
-rpath-link=~/Android/out/target/product/maguro/system/lib
-rpath=~/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

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

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


More information about the LLVMbugs mailing list