[llvm-bugs] [Bug 51957] New: Miscompilation in Botan's SHA3 with optimization -O2 and -O3

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Sep 24 06:55:29 PDT 2021


https://bugs.llvm.org/show_bug.cgi?id=51957

            Bug ID: 51957
           Summary: Miscompilation in Botan's SHA3 with optimization -O2
                    and -O3
           Product: clang
           Version: 12.0
          Hardware: Macintosh
                OS: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: llvm-bugzilla at renemeusel.de
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org,
                    neeilans at live.com, richard-llvm at metafoo.co.uk

Clang 12 and Apple Clang 13 seem to cause a miscompilation for optimization
levels -O2 and -O3 in the C++ SHA3 implementation of the Botan library.

GitHub issue with detailed investigation steps and a minimal reproducer that
doesn't depend on Botan:
https://github.com/randombit/botan/issues/2802#issuecomment-926055635

GitHub pull request with a workaround:
https://github.com/randombit/botan/pull/2803

In the reproducing program, wrong results seem to surface in line 3 of
SHA3_round():

const uint64_t C2 = A[2] ^ A[7] ^ A[12] ^ A[17] ^ A[22];

for the given input values, the result in C2 would be too large to fit into a
64-bit signed integer. FWIW.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20210924/f1e9b29b/attachment.html>


More information about the llvm-bugs mailing list