<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 --- - "Invalid constantexpr cast!" assertion in the ThreadSanitizer pass"
   href="http://llvm.org/bugs/show_bug.cgi?id=18146">18146</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>"Invalid constantexpr cast!" assertion in the ThreadSanitizer pass
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </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>Miscellaneous Instrumentation passes
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>glider@google.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>dvyukov@google.com, kcc@google.com, 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=11669" name="attach_11669" title="repro">attachment 11669</a> <a href="attachment.cgi?id=11669&action=edit" title="repro">[details]</a></span>
repro

table.ii is the attached repro.

$ clang++   -pthread  -fPIC   -fsanitize=thread -fPIC  -O2    -c table.ii  -o
table.o 

clang-3.4:
/usr/local/google/home/dtoolsbot/slave/linux-chrome-tsan/build/llvm/lib/IR/Constants.cpp:1448:
static llvm::Constant* llvm::ConstantExpr::getCast(unsigned int,
llvm::Constant*, llvm::Type*): Assertion `CastInst::castIsValid(opc, C, Ty) &&
"Invalid constantexpr cast!"' failed.
0  clang-3.4       0x00000000016be332 llvm::sys::PrintStackTrace(_IO_FILE*) +
34
1  clang-3.4       0x00000000016bd719
2  libpthread.so.0 0x00007fead2529cb0
3  libc.so.6       0x00007fead197e425 gsignal + 53
4  libc.so.6       0x00007fead1981b8b abort + 379
5  libc.so.6       0x00007fead19770ee
6  libc.so.6       0x00007fead1977192
7  clang-3.4       0x00000000014f0db5 llvm::ConstantExpr::getCast(unsigned int,
llvm::Constant*, llvm::Type*) + 581
8  clang-3.4       0x0000000002381548
9  clang-3.4       0x0000000002383bfc
10 clang-3.4       0x000000000159932f
llvm::FPPassManager::runOnFunction(llvm::Function&) + 607
11 clang-3.4       0x000000000159939b
llvm::FPPassManager::runOnModule(llvm::Module&) + 43
12 clang-3.4       0x0000000001598eef
llvm::legacy::PassManagerImpl::run(llvm::Module&) + 927
13 clang-3.4       0x00000000016e454e
clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::CodeGenOptions
const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::Module*,
clang::BackendAction, llvm::raw_ostream*) + 3582
14 clang-3.4       0x00000000016e18cd
15 clang-3.4       0x00000000019fda64 clang::ParseAST(clang::Sema&, bool, bool)
+ 372
16 clang-3.4       0x000000000191c9aa clang::FrontendAction::Execute() + 282
17 clang-3.4       0x00000000018fff30
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 352
18 clang-3.4       0x00000000016c269d
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1693
19 clang-3.4       0x0000000000754ed0 cc1_main(char const**, char const**, char
const*, void*) + 1232
20 clang-3.4       0x0000000000734b29 main + 665
21 libc.so.6       0x00007fead196976d __libc_start_main + 237
22 clang-3.4       0x00000000007520e5
Stack dump:
0.    Program arguments:
/usr/local/google/home/dtoolsbot/slave/linux-chrome-tsan/build/clang_build/bin/clang-3.4
-cc1 -triple x86_64-unknown-linux-gnu -emit-obj -disable-free -main-file-name
table.ii -mrelocation-model pic -pic-level 2 -fmath-errno -masm-verbose
-mconstructor-aliases -munwind-tables -target-cpu x86-64
-momit-leaf-frame-pointer -coverage-file
/usr/local/google/home/dtoolsbot/table.o -resource-dir
/usr/local/google/home/dtoolsbot/slave/linux-chrome-tsan/build/clang_build/bin/../lib/clang/3.5
-O2 -fdeprecated-macro -fdebug-compilation-dir /usr/local/google/home/dtoolsbot
-ferror-limit 19 -fmessage-length 134 -fsanitize=thread -pthread -mstackrealign
-fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option
-fcolor-diagnostics -vectorize-loops -vectorize-slp -o table.o -x
c++-cpp-output table.ii 
1.    <eof> parser at end of file
2.    Per-module optimization passes
3.    Running pass 'Function Pass Manager' on module 'table.ii'.
4.    Running pass 'ThreadSanitizer' on function '@_ZThn32_N8Builder3D1Ev'
clang-3.4: error: unable to execute command: Aborted (core dumped)
clang-3.4: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 3.5 (196488)
Target: x86_64-unknown-linux-gnu
Thread model: posix</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>