[LLVMbugs] [Bug 8947] New: Miscompilation when optimizing OpenSSL

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sun Jan 9 21:14:53 PST 2011


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

           Summary: Miscompilation when optimizing OpenSSL
           Product: new-bugs
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: jhendrix at galois.com
                CC: llvmbugs at cs.uiuc.edu


Created an attachment (id=5979)
 --> (http://llvm.org/bugs/attachment.cgi?id=5979)
Test case reduced by bugpoint

In trying to build OpenSSL with clang, I ran into a crypto algorithm where the
LLVM optimizer is generating bad code.  This error was found on LLVM 2.8, but I
have reproduced it on 2.9-svn.

I was able to extract a simple test case and use bugpoint to narrow down the
bug into LLVM's optimizer, and have attached LLVM code that triggered the bug.

To reproduce the bug use the following script:

opt -o bad-reduced.bc good-reduced.ll -no-aa -tbaa -basicaa -globalopt -ipsccp
-deadargelim -instcombine -simplifycfg -basiccg -prune-eh -inline
-functionattrs -domtree -domfrontier -scalarrepl -early-cse -simplify-libcalls
-lazy-value-info -jump-threading -correlated-propagation -simplifycfg
-instcombine -tailcallelim -simplifycfg -reassociate -domtree -loops
-loopsimplify -lcssa -loop-rotate -licm -lcssa -loop-unswitch -instcombine
-scalar-evolution -loopsimplify -lcssa -iv-users -indvars -loop-idiom
-loop-deletion -loop-unroll -instcombine -memdep -gvn -memdep -memcpyopt -sccp
-instcombine -lazy-value-info -jump-threading -correlated-propagation -domtree
-memdep -dse -adce -simplifycfg -strip-dead-prototypes -print-used-types
-deadtypeelim -constmerge -preverify -domtree -verify

echo "Running unoptimized"
clang -o good-reduced good-reduced.ll && ./good-reduced
echo "Running optimized"
clang -o bad-reduced bad-reduced.bc && ./bad-reduced

On my machine, the following output shows the expected result:

Running unoptimized
ok     10ce4c18
broken 4c
ok     527039d8
broken 39
Running optimized
ok     10ce4c18
broken 4e
ok     320ab844
broken ba

-- 
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