<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - fatal error: error in backend: Cannot select: 0x344cf50: i8,ch = AtomicSwap"
   href="http://llvm.org/bugs/show_bug.cgi?id=17163">17163</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>fatal error: error in backend: Cannot select: 0x344cf50: i8,ch = AtomicSwap
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>3.3
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>-New Bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>simmons.44@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=11168" name="attach_11168" title="Preprocessed Source">attachment 11168</a> <a href="attachment.cgi?id=11168&action=edit" title="Preprocessed Source">[details]</a></span>
Preprocessed Source

__c11_atomic_xxx operations fail to compile when attempted on a file scope
static variable. Preprocessed source attached.

llc output:
atomic store operand must be power-of-two byte-sized integer
  store atomic i1 true, i1* @test release, align 1
 i1Broken module found, compilation aborted!
0  libLLVM-3.3.so  0x00007fdbe34ad112 llvm::sys::PrintStackTrace(_IO_FILE*) +
34
1  libLLVM-3.3.so  0x00007fdbe34acf79
2  libpthread.so.0 0x00007fdbe25b2870
3  libc.so.6       0x00007fdbe1f2a3d9 gsignal + 57
4  libc.so.6       0x00007fdbe1f2b7d8 abort + 328
5  libLLVM-3.3.so  0x00007fdbe2d06f01
6  libLLVM-3.3.so  0x00007fdbe2d0efb5
7  libLLVM-3.3.so  0x00007fdbe2cf1a57
llvm::FPPassManager::runOnFunction(llvm::Function&) + 471
8  libLLVM-3.3.so  0x00007fdbe2cf1aeb
llvm::FPPassManager::runOnModule(llvm::Module&) + 43
9  libLLVM-3.3.so  0x00007fdbe2cf1d1b
llvm::MPPassManager::runOnModule(llvm::Module&) + 523
10 libLLVM-3.3.so  0x00007fdbe2cf3cfc llvm::PassManagerImpl::run(llvm::Module&)
+ 172
11 llc             0x000000000040cdb4
12 llc             0x000000000040bdc8 main + 376
13 libc.so.6       0x00007fdbe1f16bc5 __libc_start_main + 245
14 llc             0x000000000040be21
Stack dump:
0.    Program arguments: llc atomic_test.ll 
1.    Running pass 'Function Pass Manager' on module 'atomic_test.ll'.
2.    Running pass 'Module Verifier' on function '@main'

clang output:

fatal error: error in backend: Cannot select: 0x344cf50: i8,ch = AtomicSwap
0x344ce50:1,
      0x344d150, 0x3449f80<Volatile ST1[@test]> [ID=28]
  0x344d150: i64 = X86ISD::Wrapper 0x344d450 [ID=19]
    0x344d450: i64 = TargetGlobalAddress<i1* @test> 0 [ID=16]
  0x3449f80: i8 = Constant<1> [ORD=3] [ID=15]
In function: main
clang: error: clang frontend command failed with exit code 70 (use -v to see
invocation)
clang version 3.3 (tags/RELEASE_33/final)
Target: x86_64-unknown-linux-gnu
Thread model: posix

clang invocation:

clang -cc1 -triple x86_64-unknown-linux-gnu -S -disable-free
-disable-llvm-verifier -main-file-name atomic_test.c -mrelocation-model static
-fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables
-fuse-init-array -target-cpu x86-64 -target-linker-version 2.23.2
-momit-leaf-frame-pointer -O2 -Wall -Wextra -std=c11 -ferror-limit 19
-fmessage-length 90 -pthread -mstackrealign -fobjc-runtime=gcc
-fobjc-default-synthesize-properties -fdiagnostics-show-option
-fcolor-diagnostics -backend-option -vectorize-loops -x c atomic_test-rjAMdm.c</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>