Excessive stack usage in FLambda middle end. #7842
Original bug ID: 7842
Dear OCaml devs, Jason Gross has reported a case where flambda-enabled ocamlopt stacks overflow whereas the normal version compiles fine.
Increasing the stack limit solves the issue, so I am unsure if you would even consider this a bug, but reporting anyways.
Original Coq issue: coq/coq#8313
Steps to reproduce
Download the file: https://github.com/coq/coq/files/2328849/unsaturated_solinas.tar.gz
Then compile with 4.07.0+flambda. The stack trace is:
Comment author: @chambart
The particular part of flambda that is failing is not tail recursive due to an optimization to limit allocations. It is possible to mitigate this without allocating too much, but this would be quite tedious. Would you consider that critical enough to dedicate more time to it ?