<html>
    <head>
      <base href="https://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 --- - Metal internal compiler error"
   href="https://llvm.org/bugs/show_bug.cgi?id=23406">23406</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Metal internal compiler error
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </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>release blocker
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>new bugs
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>h.hamm@dsfishlabs.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=14279" name="attach_14279" title="Metal Shader File that causes the error">attachment 14279</a> <a href="attachment.cgi?id=14279&action=edit" title="Metal Shader File that causes the error">[details]</a></span>
Metal Shader File that causes the error

Recently tried to compile an autogenerated metal shader and got an internal
compiler error and a notice that I should report a bug. The used metal shader
is assigend as attachment and here comes the stack trace:

STACK TRACE:
<MyProjectDir Prompt>$
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/usr/bin/metal
metalshader.metal -std=ios-metal1.0
metalshader.metal:284:16: warning: unused variable 'normalDirL'
[-Wunused-variable]
                        const half3 normalDirL = in.v_normalDirL;
               ^
metalshader.metal:291:10: warning: unused variable 'diffuseLight'
[-Wunused-variable]
                float3 diffuseLight = float3(0.0,0.0,0.0);
         ^
metalshader.metal:255:9: warning: unused variable 'ambientocclusionTexel'
[-Wunused-variable]
                        half ambientocclusionTexel = ambientocclusionTexture.a;
        ^
metalshader.metal:253:9: warning: unused variable 'glossTexel'
[-Wunused-variable]
                        half glossTexel = half(materialUniforms.Gloss_Amount);
        ^
metalshader.metal:104:25: warning: unused variable 'MAX_LIGHTS'
[-Wunused-const-variable]
constexpr constant uint MAX_LIGHTS = 0;
                        ^
0  metal                    0x000000010c8c6a68
llvm::SmallVectorImpl<char>::swap(llvm::SmallVectorImpl<char>&) + 14488
1  metal                    0x000000010c8c6e54
llvm::SmallVectorImpl<char>::swap(llvm::SmallVectorImpl<char>&) + 15492
2  libsystem_platform.dylib 0x00007fff87039f1a _sigtramp + 26
3  metal                    0x000000010c907b95 bool
std::__1::__insertion_sort_incomplete<llvm::less_first&,
std::__1::pair<unsigned int, llvm::StoreInst*>*>(std::__1::pair<unsigned int,
llvm::StoreInst*>*, std::__1::pair<unsigned int, llvm::StoreInst*>*,
llvm::less_first&) + 32581
4  metal                    0x000000010ce7ff15
std::__1::__split_buffer<std::__1::pair<llvm::PointerIntPair<llvm::CallGraphNode*,
1u, unsigned int, llvm::PointerLikeTypeTraits<llvm::CallGraphNode*> >,
llvm::mapped_iterator<std::__1::__wrap_iter<std::__1::pair<llvm::WeakVH,
llvm::CallGraphNode*>*>,
std::__1::pointer_to_unary_function<std::__1::pair<llvm::WeakVH,
llvm::CallGraphNode*>, llvm::CallGraphNode*> > >,
std::__1::allocator<std::__1::pair<llvm::PointerIntPair<llvm::CallGraphNode*,
1u, unsigned int, llvm::PointerLikeTypeTraits<llvm::CallGraphNode*> >,
llvm::mapped_iterator<std::__1::__wrap_iter<std::__1::pair<llvm::WeakVH,
llvm::CallGraphNode*>*>,
std::__1::pointer_to_unary_function<std::__1::pair<llvm::WeakVH,
llvm::CallGraphNode*>, llvm::CallGraphNode*> > > >&>::~__split_buffer() + 1711
5  metal                    0x000000010c568dc6
std::__1::__tree<std::__1::__value_type<llvm::Function const*,
llvm::CallGraphNode*>, std::__1::__map_value_compare<llvm::Function const*,
std::__1::__value_type<llvm::Function const*, llvm::CallGraphNode*>,
std::__1::less<llvm::Function const*>, true>,
std::__1::allocator<std::__1::__value_type<llvm::Function const*,
llvm::CallGraphNode*> >
<span class="quote">>::destroy(std::__1::__tree_node<std::__1::__value_type<llvm::Function const*,</span >
llvm::CallGraphNode*>, void*>*) + 2726
6  metal                    0x000000010c4a643f void
llvm::DeleteContainerSeconds<llvm::DenseMap<llvm::Type*, llvm::UndefValue*,
llvm::DenseMapInfo<llvm::Type*> > >(llvm::DenseMap<llvm::Type*,
llvm::UndefValue*, llvm::DenseMapInfo<llvm::Type*> >&) + 31599
7  metal                    0x000000010cc4e51f
std::__1::__vector_base<llvm::coverage::CounterMappingRegion,
std::__1::allocator<llvm::coverage::CounterMappingRegion> >::~__vector_base() +
64371
8  metal                    0x000000010cd10a11
llvm::SmallVectorTemplateBase<llvm::DenseMap<clang::BaseSubobject, unsigned
long long, llvm::DenseMapInfo<clang::BaseSubobject> >, false>::grow(unsigned
long) + 11685
9  metal                    0x000000010ce80736
std::__1::__split_buffer<std::__1::pair<llvm::PointerIntPair<llvm::CallGraphNode*,
1u, unsigned int, llvm::PointerLikeTypeTraits<llvm::CallGraphNode*> >,
llvm::mapped_iterator<std::__1::__wrap_iter<std::__1::pair<llvm::WeakVH,
llvm::CallGraphNode*>*>,
std::__1::pointer_to_unary_function<std::__1::pair<llvm::WeakVH,
llvm::CallGraphNode*>, llvm::CallGraphNode*> > >,
std::__1::allocator<std::__1::pair<llvm::PointerIntPair<llvm::CallGraphNode*,
1u, unsigned int, llvm::PointerLikeTypeTraits<llvm::CallGraphNode*> >,
llvm::mapped_iterator<std::__1::__wrap_iter<std::__1::pair<llvm::WeakVH,
llvm::CallGraphNode*>*>,
std::__1::pointer_to_unary_function<std::__1::pair<llvm::WeakVH,
llvm::CallGraphNode*>, llvm::CallGraphNode*> > > >&>::~__split_buffer() + 3792
10 metal                    0x000000010cd0fd3a
llvm::SmallVectorTemplateBase<llvm::DenseMap<clang::BaseSubobject, unsigned
long long, llvm::DenseMapInfo<clang::BaseSubobject> >, false>::grow(unsigned
long) + 8398
11 metal                    0x000000010ce04b00
std::__1::__tree<std::__1::__value_type<clang::edit::FileOffset,
clang::edit::EditedSource::FileEdit>,
std::__1::__map_value_compare<clang::edit::FileOffset,
std::__1::__value_type<clang::edit::FileOffset,
clang::edit::EditedSource::FileEdit>, std::__1::less<clang::edit::FileOffset>,
true>, std::__1::allocator<std::__1::__value_type<clang::edit::FileOffset,
clang::edit::EditedSource::FileEdit> >
<span class="quote">>::destroy(std::__1::__tree_node<std::__1::__value_type<clang::edit::FileOffset,</span >
clang::edit::EditedSource::FileEdit>, void*>*) + 4720
12 metal                    0x000000010cde16c6
std::__1::__vector_base<clang::CompilerInstance*,
std::__1::allocator<clang::CompilerInstance*> >::~__vector_base() + 13966
13 metal                    0x000000010ce2d349 char const*
std::__1::__search<std::__1::__equal_to<char, char>&, char const*, char
const*>(char const*, char const*, char const*, char const*,
std::__1::__equal_to<char, char>&, std::__1::random_access_iterator_tag,
std::__1::random_access_iterator_tag) + 3609
14 metal                    0x000000010be9aa54
std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>,
std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char,
std::__1::char_traits<char>, std::__1::allocator<char> > > >::deallocate() +
3092
15 metal                    0x000000010be9d236
std::__1::__vector_base<llvm::AssertingVH<llvm::Instruction>,
std::__1::allocator<llvm::AssertingVH<llvm::Instruction> > >::~__vector_base()
+ 8070
16 libdyld.dylib            0x00007fff88ecd5c9 start + 1
metal: error: unable to execute command: Segmentation fault: 11
metal: error: clang frontend command failed due to signal (use -v to see
invocation)
LLVM version 3.5 
Target: air64-apple-darwin14.3.0
Thread model: posix
metal: 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.
metal: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
metal: note: diagnostic msg:
/var/folders/qy/414mvr4108s6_0n26mcs8pn80000gn/T/metalshader-f75c5a.metal
metal: note: diagnostic msg:
/var/folders/qy/414mvr4108s6_0n26mcs8pn80000gn/T/metalshader-f75c5a.sh
metal: note: diagnostic msg: 

********************
<MyProjectDir Prompt>$
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/usr/bin/metal
--version
LLVM version 3.5 
Target: x86_64-apple-darwin14.3.0
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>