<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </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 musttail crash on arm32"
   href="https://bugs.llvm.org/show_bug.cgi?id=51416">51416</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>clang musttail crash on arm32
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>-New Bugs
          </td>
        </tr>

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

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

        <tr>
          <th>CC</th>
          <td>htmldeveloper@gmail.com, llozano@chromium.org, llvm-bugs@lists.llvm.org, manojgupta@google.com, neeilans@live.com, richard-llvm@metafoo.co.uk
          </td>
        </tr></table>
      <p>
        <div>
        <pre>A new feture in clang [[msuttail]] is causing clang to cash on our internal
builds.

Reduced test case:

typedef long a;
typedef short b;
typedef long long c;
class d;
class e;
struct f {};
struct g;
class h {
public:
  enum i { j };
};
template <unsigned> struct k : h {
  static char *l(d *, const char *, e *, const g *, c, f);
  template <typename, typename, i>
  static const char *m(d *, const char *, e *, const g *, c, f);
};
template <unsigned n>
template <typename, typename, h::i>
const char *k<n>::m(d *o, const char *p, e *p3, const g *q, c r, f s) {
  [[clang::musttail]] return l(o, p, p3, q, r, s);
}
template const char *k<1>::m<a, b, h::j>(d *, const char *, e *, const g *, c,
                                         f);
clang++ -target armv7a-linux-gnueabihf -mfpu=neon tctable_lite.cpp -c

fatal error: error in backend: failed to perform tail call elimination on a
call site marked musttail
PLEASE submit a bug report to <a href="https://crbug.com">https://crbug.com</a> and run
tools/clang/scripts/process_crashreports.py (only works inside Google) which
will upload a report and include the crash backtrace, preprocessed source, and
associated run script.
Stack dump:
0.      Program arguments:
/usr/local/google/home/manojgupta/chromeclang/third_party/llvm-build/Release+Asserts/bin/clang++
-target armv7a-linux-gnueabihf -mfpu=neon
generated_message_tctable_lite-b3fd7e.cpp -c
1.      <eof> parser at end of file
2.      Code generation
3.      Running pass 'Function Pass Manager' on module
'generated_message_tctable_lite-b3fd7e.cpp'.
4.      Running pass 'ARM Instruction Selection' on function
'@_ZN1kILj1EE1mIlsLN1h1iE0EEEPKcP1dS5_P1ePK1gx1f'
#0 0x00000000033130b8 

clang: error: clang frontend command failed with exit code 70 (use -v to see
invocation)
clang version 14.0.0 (<a href="https://github.com/llvm/llvm-project/">https://github.com/llvm/llvm-project/</a>
7d9d926a1861e2f6876943d47f297e2a08a57392)
Target: armv7a-unknown-linux-gnueabihf

Still repros on ToT.</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>