replimoc / compiler

8 stars 0 forks source link

StackPointer (// FIXME: static stack reservation is no solution) #205

Closed effenok closed 9 years ago

effenok commented 9 years ago

now the code does following:

1) at the start block allocate stack size (static with todo) subq $0x200, %rsp # static stack reservation 2) when values are stored on stack the stack is not modified movl %edx, -0x10(%rbp) # Store node Mul Is[78:19] 3) when print_int is called stack is aligned to 16 bytes

pushq %rsp
pushq (%rsp)
andq $-0x10, %rsp
#etc
call print_int

something of this is too much:

I propose - at the end of assembly generation find the first subq instruction and replace its static offset with the value of stack offset, aligned to 16byte and remove stack alignment from calls

vzickner commented 9 years ago

I propose: Implement register allocation ( #184 ). This also solves this problem.

effenok commented 9 years ago

will you implement #184 before 11.01?

Because now, if you have more than 0x200 items on the stack the problem will probably fail, and I think that our advisors will find a test case for it

so, either you implement #184 before 11.01, or you return updates to stack pointer after every write to the stack, or we implement this fix, which I believe is - insert three lines of code and remove the code in (3)

vzickner commented 9 years ago

yes, we will implement #184 before 11.01.