[Llvm-bgq-discuss] clang ICE: std::atomic<uint_fast16_t>

Michael Blocksome blocksom at us.ibm.com
Tue Feb 5 16:25:58 CST 2013


One other thing .. the 'store' method gives the same failure, but the 
'exchange' method seems to work.

std::atomic<uint_fast16_t> b;
b = 0;          // fail
b.store(0);     // fail
b.exchange(0);  // success

Michael Blocksome
Blue Gene Messaging
blocksom at us.ibm.com




From:   Michael Blocksome/Rochester/IBM at IBMUS
To:     llvm-bgq-discuss at lists.alcf.anl.gov, 
Date:   02/05/2013 04:21 PM
Subject:        [Llvm-bgq-discuss] clang ICE: std::atomic<uint_fast16_t>
Sent by:        llvm-bgq-discuss-bounces at lists.alcf.anl.gov



I recently learned that I should not be using types such as 'uint32_t' for 
atomics, but instead should use the "fast" versions of these types, such 
as 'uint_fast32_t'. However, when I use these "fast" types with clang and 
the std::atomic::operator= overload I get a nasty ICE. 

I get the same ICE with 'uint64_t', so I'm guessing that 'uint_fast*_t' is 
a typedef to 'uint64_t'... 

---- 

$> cat atomic_store.cc 

#include <atomic> 

int main () 
{ 
  // this works fine ... 
  std::atomic<uint_fast16_t> a(0); 
  a++; 

  std::atomic<uint_fast16_t> b; 
  b = 0; // fail 

  std::atomic<uint16_t> c; 
  c = 0; // success 

  std::atomic<uint32_t> d; 
  d = 0; // success 
 
  std::atomic<uint64_t> e; 
  e = 0; // fail 

  std::atomic<uint_fast32_t> f; 
  f = 0; // fail 

  return 0; 
}; 

$> /bghome/blocksom/development/c++11/bgclang++ -ferror-limit=10 -I 
/bghome/blocksom/development/c++11/install/libc++/include -std=c++11 
-stdlib=libc++ -g -c atomic_store.cc -o atomic_store.o 
fatal error: error in backend: Cannot select: 0x10005b64a80: ch = 
AtomicStore 0x10005b67ac0, 0x10005b66ca0, 0x10005b679c0<Volatile 
ST8[%__a_.i.i62]> [ID=10] 
 dbg:/bghome/blocksom/development/c++11/install/libc++/include/atomic:571 
  0x10005b66ca0: i64,ch = CopyFromReg 0x10005ac0660, 0x10005b60c30 [ID=8] 
dbg:/bghome/blocksom/development/c++11/install/libc++/include/atomic:571 
    0x10005b60c30: i64 = Register %vreg1 [ID=5] 
  0x10005b679c0: i64,ch = load 0x10005ac0660, 0x10005b65390, 
0x10005b61230<LD8[%.atomictmp.i.i57]> [ORD=98] [ID=7] 
dbg:/bghome/blocksom/development/c++11/install/libc++/include/atomic:571 
    0x10005b65390: i64 = FrameIndex<14> [ORD=98] [ID=1] 
    0x10005b61230: i64 = undef [ORD=98] [ID=2] 
In function: main 
clang: error: clang frontend command failed with exit code 70 (use -v to 
see invocation) 
clang version 3.3 (trunk 170456) 
Target: powerpc64-bgq-linux 
Thread model: posix 
clang: note: diagnostic msg: PLEASE submit a bug report to 
http://llvm.org/bugs/ and include the crash backtrace, preprocessed 
source, and associated run script. 
clang: note: diagnostic msg: 
******************** 

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT: 
Preprocessed source(s) and associated run script(s) are located at: 
clang: note: diagnostic msg: /tmp/atomic_store-j00aLw.cpp 
clang: note: diagnostic msg: /tmp/atomic_store-j00aLw.sh 
clang: note: diagnostic msg: 

******************** 

Any ideas? 


--> http://en.cppreference.com/w/c/types/integer 
--> http://en.cppreference.com/w/cpp/atomic/atomic/operator%3D 

Thanks, 

Michael Blocksome
Blue Gene Messaging
blocksom at us.ibm.com_______________________________________________
llvm-bgq-discuss mailing list
llvm-bgq-discuss at lists.alcf.anl.gov
https://lists.alcf.anl.gov/mailman/listinfo/llvm-bgq-discuss

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alcf.anl.gov/pipermail/llvm-bgq-discuss/attachments/20130205/9db14598/attachment.html>


More information about the llvm-bgq-discuss mailing list