Skip to content

compiler generate invalid arm code for function with large stack and callee_saved resgiter #709

Closed
@bgregoir

Description

@bgregoir

param int N = 1024;
param int T = 10;

export fn main() -> reg u32 {
stack u32[N] s;
reg ptr u32[N] ps;
reg u32 i n d;
inline int j;

i = 0;
n = N;
ps = s;
while(i < n) {
ps[i] = i;
i += 1;
}

reg u32[T] t;
for j = 0 to T {
t[j] = ps[j];
}
i = T;
n = (N / T) * T;
while (i < n) {
for j = 0 to T {
d = ps[i];
t[j] += d;
i += 1;
}
}
n = N;
while (i < n) {
d = ps[i];
t[0] += d;
i += 1;
}

for j = 1 to T {
t[0] += t[j];
}

i = t[0];
return i;

}

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions