Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ARM - compilation error when copying reg ptr into the stack #622

Closed
tfaoliveira opened this issue Oct 18, 2023 · 1 comment
Closed

ARM - compilation error when copying reg ptr into the stack #622

tfaoliveira opened this issue Oct 18, 2023 · 1 comment
Assignees
Labels
arm Related to the arm port bug

Comments

@tfaoliveira
Copy link
Member

When I compile the following program:

u32[1] C = {1};

export fn main() -> reg u32
{
  reg ptr u32[1] Cp;
  stack ptr u32[1] Cps;
  reg u32 c;

  Cp = C;
  Cps = Cp;
  Cp = Cps;
  c = Cp[0];
  return c;
}

I get:

, line 10 (2-11):
compilation error in function main:
asmgen: instruction ADD is given incompatible args.
Allowed args are:
  [[reg]; [reg]; [reg]]
  [[reg]; [reg]; [imm 32]]

Line 10, corresponds to Cps = Cp;.

Is seems that it is not possible to move a reg ptr into the stack. Is this a bug?

@tfaoliveira tfaoliveira added question arm Related to the arm port labels Oct 18, 2023
@vbgl
Copy link
Member

vbgl commented Oct 19, 2023

Thanks for the report. That’s a bug: stack-alloc is emitting invalid instructions.

@vbgl vbgl self-assigned this Oct 19, 2023
@vbgl vbgl added bug and removed question labels Oct 19, 2023
@bgregoir bgregoir self-assigned this Oct 19, 2023
bgregoir added a commit that referenced this issue Oct 19, 2023
vbgl pushed a commit that referenced this issue Oct 19, 2023
@vbgl vbgl removed their assignment Oct 19, 2023
@vbgl vbgl closed this as completed in 188d781 Oct 19, 2023
vbgl pushed a commit that referenced this issue Oct 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arm Related to the arm port bug
Projects
None yet
Development

No branches or pull requests

3 participants