<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 --- - Unwind tables can't be generated when using inline asm"
   href="http://llvm.org/bugs/show_bug.cgi?id=22523">22523</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Unwind tables can't be generated when using inline asm
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>3.5
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Macintosh
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>MacOS X
          </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>C++
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>mjbshaw@hotmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>dgregor@apple.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=13830" name="attach_13830" title="The first file requested by the clang diagnostic message">attachment 13830</a> <a href="attachment.cgi?id=13830&action=edit" title="The first file requested by the clang diagnostic message">[details]</a></span>
The first file requested by the clang diagnostic message

If I compile a very simple C++ program, clang crashes complaining that the
address of an intrinsic cannot be taken. As far as I can tell, clang should be
able to compile this, and the fact that it cannot is a bug. The invocation and
output are:

$ clang++-3.5 -v -emit-llvm -target mipsel -o out.bc -c t.cc              ⏎ ✱ ◼
clang version 3.5.1 (tags/RELEASE_351/final)
Target: mipsel
Thread model: posix
 "/usr/local/Cellar/llvm35/3.5.1/lib/llvm-3.5/bin/clang" -cc1 -triple mipsel
-emit-llvm-bc -disable-free -main-file-name t.cc -mrelocation-model static
-mdisable-fp-elim -fmath-errno -no-integrated-as -mconstructor-aliases
-target-cpu mips32r2 -target-feature -n64 -target-feature +o32 -target-abi o32
-mfloat-abi hard -target-linker-version 241.9 -v -dwarf-column-info
-coverage-file /Users/mjbshaw/School/cs6960/a2/pathtracer/out.bc -resource-dir
/usr/local/Cellar/llvm35/3.5.1/lib/llvm-3.5/bin/../lib/clang/3.5.1
-fdeprecated-macro -fno-dwarf-directory-asm -fdebug-compilation-dir
/Users/mjbshaw/School/cs6960/a2/pathtracer -ferror-limit 19 -fmessage-length
112 -mstackrealign -fobjc-runtime=gcc -fcxx-exceptions -fexceptions
-fdiagnostics-show-option -fcolor-diagnostics -o out.bc -x c++ t.cc
clang -cc1 version 3.5.1 based upon LLVM 3.5.1 default target
x86_64-apple-darwin14.1.0
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include
 /usr/local/Cellar/llvm35/3.5.1/lib/llvm-3.5/bin/../lib/clang/3.5.1/include
 /usr/include
End of search list.
Cannot take the address of an intrinsic!
  %call = invoke i32 @llvm.mips.loadi(i32 signext 0, i32 signext 0)
          to label %invoke.cont unwind label %lpad
Cannot take the address of an intrinsic!
  %call = invoke i32 @llvm.mips.loadi(i32 signext 0, i32 signext 0)
          to label %invoke.cont unwind label %lpad
fatal error: error in backend: Broken function found, compilation aborted!
clang: error: clang frontend command failed with exit code 70 (use -v to see
invocation)
clang version 3.5.1 (tags/RELEASE_351/final)
Target: mipsel
Thread model: posix
clang: note: diagnostic msg: PLEASE submit a bug report to
<a href="http://llvm.org/bugs/">http://llvm.org/bugs/</a> 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:
/var/folders/vf/2d0_lsz10zz_31khhsxhsn5r0000gn/T/t-8d447b.cpp
clang: note: diagnostic msg:
/var/folders/vf/2d0_lsz10zz_31khhsxhsn5r0000gn/T/t-8d447b.sh
clang: note: diagnostic msg: 

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



If I compile with -fno-exceptions, then it compiles successfully (presumably
because there are no unwind tables being created). Additionally, if I move the
declaration/definition of the variable foo to *after* the loadi function call,
then it compiles successfully (even without -fno-exceptions).</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>