<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from text --><style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<div>
<div id="x_compose-container" itemscope="" itemtype="https://schema.org/EmailMessage" style="direction:ltr">
<span itemprop="creator" itemscope="" itemtype="https://schema.org/Organization"><span itemprop="name"></span></span>
<div>
<div>
<div style="direction:ltr">Fyi the C backend completely works here, but everything must be compiled with the same backend, and gcc and C backend do not interoperate -- they pass the static link differently.</div>
</div>
<div><br>
</div>
<div class="x_acompli_signature">- Jay</div>
</div>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> M3commit <m3commit-bounces@elegosoft.com> on behalf of GitHub <noreply@github.com><br>
<b>Sent:</b> Thursday, August 24, 2017 3:32:53 PM<br>
<b>To:</b> m3commit@elegosoft.com<br>
<b>Subject:</b> [M3commit] [modula3/cm3] 90b335: Fix special-case passing of static link parameter.</font>
<div> </div>
</div>
</div>
<font size="2"><span style="font-size:10pt;">
<div class="PlainText">  Branch: refs/heads/master<br>
  Home:   <a href="https://github.com/modula3/cm3">https://github.com/modula3/cm3</a><br>
  Commit: 90b335e7ae53393d9dfc78f690e39a7cad49e086<br>
      <a href="https://github.com/modula3/cm3/commit/90b335e7ae53393d9dfc78f690e39a7cad49e086">
https://github.com/modula3/cm3/commit/90b335e7ae53393d9dfc78f690e39a7cad49e086</a><br>
  Author: Rodney Bates <rodney.m.bates@acm.org><br>
  Date:   2017-08-24 (Thu, 24 Aug 2017)<br>
<br>
  Changed paths:<br>
    M m3-sys/llvm3.6.1/src/M3CG_LLVM.m3<br>
<br>
  Log Message:<br>
  -----------<br>
  Fix special-case passing of static link parameter.<br>
<br>
Add the llvm 'nest' attribute to the static link parameter, both<br>
for direct and indirect calls.  This causes llvm to pass this<br>
parameter in the way the target ABI specifies for a static link.<br>
Without this, everything was almost working except for execution<br>
of a finally block when an exception propagated through it.  This<br>
would probably have worked too, if the runtime were also compiled<br>
with the llvm backend.  But RTExFrame passes a static link to user<br>
code, and, if compiled by different back ends, these were using<br>
different parameter conventions.<br>
<br>
With this change, all test cases that pass using the gcc back end<br>
also pass using the llvm backend, plus one more (p140).  Also, llvm<br>
incorrectly shows a failure on p004.  This is only a reordering<br>
of warning messages produced by the front end, which is asked to<br>
unnest nested procedures in different order by these two back ends.<br>
<br>
This is with mixing m3cc-compiled runtime and llvm-compiled test<br>
cases, which bodes well for interoperability of these back ends.<br>
<br>
<br>
</div>
</span></font>
</body>
</html>