Skip to content

bootstrap4's %call should use stack to stage args #8

Description

@mmastrac

As return values and arguments share the same register (r0), attempting to make a call to another function where the return value is in another position other than the first one causes that argument to get corrupted.

For example:

%call function @foo, @ret will first clobber @ret (aka r0) with @foo, then attempt to put the clobbered value of r0 into r1.

Instead, %call should push the arguments to the stack and then pop them into registers. This is far less efficient, but we're not worried about efficiency in this stage.

This could potentially simplify some argument handling in bootstrap4/compiler0 as well.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions