(0001194)
|
zs
|
2022-05-03 18:06
|
|
I believe I have diagnosed the problem, though I cannot confirm it,
since I am not set up to program on Windows.
Compiling zm_huge_flat_case.m with a debug grade compiler under mdb,
the command "min_depth 10000" shows very deep mutual recursion in
parse_goal.m between parse_goal, parse_non_call_goal, and parse_goal_semicolon.
Basically, you need three stack frames for each disjunct in that big
disjunction, and the different determinisms (parse_non_call_goal is semidet,
the others are det) prevent both the MLDS and the LLDS code generator
from being able to do tail recursion.
I have an idea for a solution and will try it out tomorrow, but it may
add some overhead. Once I have an implementation ready, I will need you
to run some benchmarks to see whether it adds any overhead for run-of-the-mill,
non-extreme Mercury code, and if so, whether that overhead is significant. |
|