<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 --- - clang assert in SROA with -ffake-address-space-map option"
   href="http://llvm.org/bugs/show_bug.cgi?id=19279">19279</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>clang assert in SROA with -ffake-address-space-map option
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </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>LLVM Codegen
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>kraiskil@ovi.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=12308" name="attach_12308" title="input source code">attachment 12308</a> <a href="attachment.cgi?id=12308&action=edit" title="input source code">[details]</a></span>
input source code

The attachecd input makes clang (trunk, rev205012) assert. The error does not
occur with clang/llvm 3.4, or if -ffake-address-space-map option is not given.

$ clang -cc1 -emit-llvm-bc -ffake-address-space-map -x cl minimized.cl
clang: /home/kraiskil/llvm/llvm/lib/IR/Instructions.cpp:2381: static
llvm::CastInst* llvm::CastInst::Create(llvm::Instruction::CastOps,
llvm::Value*, llvm::Type*, const llvm::Twine&, llvm::Instruction*): Assertion
`castIsValid(op, S, Ty) && "Invalid cast!"' failed.
0  libLLVM-3.5.0svn.so 0x00007f9250f7841a llvm::sys::PrintStackTrace(_IO_FILE*)
+ 38
1  libLLVM-3.5.0svn.so 0x00007f9250f786a1
2  libLLVM-3.5.0svn.so 0x00007f9250f78034
3  libpthread.so.0     0x00007f924f53f030
4  libc.so.6           0x00007f924e1c2475 gsignal + 53
5  libc.so.6           0x00007f924e1c56f0 abort + 384
6  libc.so.6           0x00007f924e1bb621 __assert_fail + 241
7  libLLVM-3.5.0svn.so 0x00007f9250875f5b
llvm::CastInst::Create(llvm::Instruction::CastOps, llvm::Value*, llvm::Type*,
llvm::Twine const&, llvm::Instruction*) + 87
8  libLLVM-3.5.0svn.so 0x00007f9250cfe4f7
9  libLLVM-3.5.0svn.so 0x00007f9250cfaff2
10 libLLVM-3.5.0svn.so 0x00007f9250cef1cf
11 libLLVM-3.5.0svn.so 0x00007f9250cf23c5
12 libLLVM-3.5.0svn.so 0x00007f9250d01f2f
13 libLLVM-3.5.0svn.so 0x00007f9250cfec21
14 libLLVM-3.5.0svn.so 0x00007f9250cfb725
15 libLLVM-3.5.0svn.so 0x00007f9250cf1665
16 libLLVM-3.5.0svn.so 0x00007f9250cf73ef
17 libLLVM-3.5.0svn.so 0x00007f9250cf7e20
18 libLLVM-3.5.0svn.so 0x00007f9250cf8637
19 libLLVM-3.5.0svn.so 0x00007f9250cf931b
20 libLLVM-3.5.0svn.so 0x00007f9250891df1
llvm::FPPassManager::runOnFunction(llvm::Function&) + 385
21 libLLVM-3.5.0svn.so 0x00007f9250891b38
llvm::legacy::FunctionPassManagerImpl::run(llvm::Function&) + 84
22 libLLVM-3.5.0svn.so 0x00007f9250891710
llvm::legacy::FunctionPassManager::run(llvm::Function&) + 180
23 clang               0x0000000000c2506f
24 clang               0x0000000000c25225
clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::CodeGenOptions
const&, clang::TargetOptions const&, clang::LangOptions const&,
llvm::StringRef, llvm::Module*, clang::BackendAction, llvm::raw_ostream*) + 133
25 clang               0x0000000000c1e2a9
26 clang               0x0000000000e4889f clang::ParseAST(clang::Sema&, bool,
bool) + 788
27 clang               0x000000000098b781
clang::ASTFrontendAction::ExecuteAction() + 321
28 clang               0x0000000000c1fe63 clang::CodeGenAction::ExecuteAction()
+ 1435
29 clang               0x000000000098b2b0 clang::FrontendAction::Execute() +
200
30 clang               0x000000000095a98e
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 720
31 clang               0x0000000000922815
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1063
32 clang               0x0000000000911972 cc1_main(char const**, char const**,
char const*, void*) + 636
33 clang               0x000000000091dff8 main + 798
34 libc.so.6           0x00007f924e1aeead __libc_start_main + 253
35 clang               0x0000000000910199
Stack dump:
0.    Program arguments: /opt/llvm/svn/bin/clang -cc1 -emit-llvm-bc
-ffake-address-space-map -x cl minimized.cl 
1.    <eof> parser at end of file
2.    Per-function optimization
3.    Running pass 'SROA' on function '@get_image_depth'
Avbruten (SIGABRT)</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>