<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<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 style="direction:ltr">
<div style="direction:ltr">1. Thank you-- the C backend is under-understood & under appreciated.</div>
<div><br>
</div>
<div style="direction:ltr">2. This should be easy -- Modula-3</div>
<div style="direction:ltr">object methods are presumably like C++ virtual member functions.
</div>
<div style="direction:ltr">There are some challenges to interop. One would want cm3</div>
<div style="direction:ltr">to generate headers & maybe glue code-- stuff around GC.</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> Rodney M. Bates <rodney_bates@lcwb.coop><br>
<b>Sent:</b> Sunday, August 27, 2017 9:33:41 AM<br>
<b>To:</b> m3devel; Jay<br>
<b>Subject:</b> Re: [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">I really would not have expected gcc and C backends to interoperate in this way, while<br>
still working with a range of standard C compilers. In fact, I am gratifyingly surprised<br>
gcc and llvm backends do. But this does not detract from the C backend's major goal<br>
of simplifying porting and bootstrapping on new machines and architectures.<br>
<br>
What I would be really love to have is inter-language binary compatibility between Modula3<br>
and C++ dispatching method calls, at least in the absence of multiple inheritance. But<br>
that would probably be quite difficult and entail changes in Modula3's current runtime<br>
model--a big and disruptive job.<br>
<br>
On 08/24/2017 06:27 PM, Jay K wrote:<br>
> 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.<br>
><br>
> - Jay<br>
> ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------<br>
> *From:* M3commit <m3commit-bounces@elegosoft.com> on behalf of GitHub <noreply@github.com><br>
> *Sent:* Thursday, August 24, 2017 3:32:53 PM<br>
> *To:* m3commit@elegosoft.com<br>
> *Subject:* [M3commit] [modula3/cm3] 90b335: Fix special-case passing of static link parameter.<br>
><br>
> 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>
><br>
><br>
> _______________________________________________<br>
> M3commit mailing list<br>
> M3commit@elegosoft.com<br>
> <a href="https://m3lists.elegosoft.com/mailman/listinfo/m3commit">https://m3lists.elegosoft.com/mailman/listinfo/m3commit</a><br>
><br>
<br>
-- <br>
Rodney Bates<br>
rodney.m.bates@acm.org<br>
</div>
</span></font>
</body>
</html>