[M3commit] [modula3/cm3] 90b335: Fix special-case passing of static link parameter.

Jay K jayk123 at hotmail.com
Fri Aug 25 01:27:37 CEST 2017

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.

- Jay
From: M3commit <m3commit-bounces at elegosoft.com> on behalf of GitHub <noreply at github.com>
Sent: Thursday, August 24, 2017 3:32:53 PM
To: m3commit at elegosoft.com
Subject: [M3commit] [modula3/cm3] 90b335: Fix special-case passing of static link parameter.

  Branch: refs/heads/master
  Home:   https://github.com/modula3/cm3
  Commit: 90b335e7ae53393d9dfc78f690e39a7cad49e086
  Author: Rodney Bates <rodney.m.bates at acm.org>
  Date:   2017-08-24 (Thu, 24 Aug 2017)

  Changed paths:
    M m3-sys/llvm3.6.1/src/M3CG_LLVM.m3

  Log Message:
  Fix special-case passing of static link parameter.

Add the llvm 'nest' attribute to the static link parameter, both
for direct and indirect calls.  This causes llvm to pass this
parameter in the way the target ABI specifies for a static link.
Without this, everything was almost working except for execution
of a finally block when an exception propagated through it.  This
would probably have worked too, if the runtime were also compiled
with the llvm backend.  But RTExFrame passes a static link to user
code, and, if compiled by different back ends, these were using
different parameter conventions.

With this change, all test cases that pass using the gcc back end
also pass using the llvm backend, plus one more (p140).  Also, llvm
incorrectly shows a failure on p004.  This is only a reordering
of warning messages produced by the front end, which is asked to
unnest nested procedures in different order by these two back ends.

This is with mixing m3cc-compiled runtime and llvm-compiled test
cases, which bodes well for interoperability of these back ends.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3commit/attachments/20170824/396143b2/attachment-0001.html>

More information about the M3commit mailing list