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

GitHub noreply at github.com
Fri Aug 25 00:32:53 CEST 2017


  Branch: refs/heads/master
  Home:   https://github.com/modula3/cm3
  Commit: 90b335e7ae53393d9dfc78f690e39a7cad49e086
      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.




More information about the M3commit mailing list