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

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Nov 29 11:46:07 PST 2011


             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
  D. o to so
-soname libtest.so -L ~/Android/out/target/product/maguro/system/lib -lc
-shared --no-undefined --fix-cortex-a8
-rpath=~/Android/out/target/product/maguro/system/lib -freloc=PIC -o
./libtest.so ./lib.o

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 llvm-bugs mailing list