What should happen here?
IGotD-
nise at nise.com
Wed Sep 22 18:52:52 UTC 2021
On Wednesday, 22 September 2021 at 18:30:41 UTC, Ali Çehreli
wrote:
>
> Shouldn't preserving the contents of registers be the
> responsibility of the compiler or the GC? And perhaps the
> compiler should skip that optimization if the contents cannot
> be preserved?
>
> Ali
Not according to most ABIs. Parameters are usually not preserved
on stack. Should it be forced on stack because of FFI? I
personally don't think so.
I think you are attacking this problem from the wrong side. It is
not a problem of the optimizer or code generation. It's not the
problem of the ABI. It's a life time issue regardless of the type
of GC you use. If a resource is moved (both temporary and
permanent) to any foreign system, you must have a way of
describing that.
More information about the Digitalmars-d
mailing list