[M3commit] [modula3/cm3] 90b335: Fix special-case passing of static link parameter.
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.
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.
Author: Rodney Bates <rodney.m.bates at acm.org>
Date: 2017-08-24 (Thu, 24 Aug 2017)
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...
More information about the M3commit