[LLVMbugs] [Bug 24101] New: [ms] clang-cl miscompiles std::atomic_flag

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sun Jul 12 17:32:12 PDT 2015


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

            Bug ID: 24101
           Summary: [ms] clang-cl miscompiles std::atomic_flag
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: nicolasweber at gmx.de
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

C:\src\chromefetch\src\third_party\llvm-build\Release+Asserts>type test.cc
#include <atomic>
#include <map>

int main(int argc, char* argv[]) {
  std::map<const char*, std::atomic_flag> Seen;

  for (int i = 1; i < argc; ++i)
    Seen[argv[i]].clear();

  for (int i = 1; i < argc; ++i)
    if (Seen[argv[i]].test_and_set())
      fprintf(stderr, "waaaaat\n");
}

C:\src\chromefetch\src\third_party\llvm-build\Release+Asserts>cl /O2 test.cc
/EHsc
Microsoft (R) C/C++ Optimizing Compiler Version 18.00.31101 for x64
Copyright (C) Microsoft Corporation.  All rights reserved.

test.cc
Microsoft (R) Incremental Linker Version 12.00.31101.0
Copyright (C) Microsoft Corporation.  All rights reserved.

/out:test.exe
test.obj

C:\src\chromefetch\src\third_party\llvm-build\Release+Asserts>test a b c

C:\src\chromefetch\src\third_party\llvm-build\Release+Asserts>bin\clang-cl /O2
test.cc

C:\src\chromefetch\src\third_party\llvm-build\Release+Asserts>test a b c
waaaaat
waaaaat



(Reduced from code in the new COFF lld)

-- 
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/20150713/33018235/attachment.html>


More information about the llvm-bugs mailing list