Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
cmd/compile: autotemps can make stack frame too large #27447
When the order pass introduces temporaries, it always allocates them on the stack, even if they are too big for the stack.
We should use the same rules as escape analysis does to decide if we should put the temporary on the stack or the heap.
@cuonglm This can be tricky. On first glance, there's not immediate problem - order can introduce calls to newobject. If the object is pointerless, it works fine. But if the object has pointers, then things that previously didn't escape now do. I think the right, athough difficult, solution would be to treat these heap-allocated things as stack somehow (no write barriers, scanned as part of stack scanning, etc.).