[m-dev.] for review: fix block nesting hits fixed limit in MSVC

Peter Ross peter.ross at miscrit.be
Tue Jul 18 17:48:29 AEST 2000


On Tue, Jul 18, 2000 at 02:29:09PM +1000, Fergus Henderson wrote:
> On 07-Jul-2000, Peter Ross <petdr at cs.mu.OZ.AU> wrote:
> > 
> > Avoid a fixed limit problem where only N levels of block nesting is
> > allowed in the MSVC compiler.
> >
> > compiler/ml_code_gen.m:
> >     ml_join_decls creates block nesting proportional to the size of the
> >     disjunction when generating disjunctions in a model_non context.
> >     Now we always create a block for each arm of the disjunction.  This
> >     allows us to safely concatenate blocks together, and hence only nest
> >     blocks one level deeper.
> 
> Do you know what the value of N is for MSVC?
> 
In MSDN it says 128, but I found it to be around 256.

> Could you give an example of the kind of source code for which
> the current MLDS code generator generates deeply nested blocks?
> Where exactly did it hit the fixed limit?
> 
While compiling the C file.

Here is an example of some code that causes deep nesting.

:- module big_multi.
:- interface.
:- type t.
:- pred multi(int::out, t::out) is multi.
:- implementation.
:- type t ---> f(string) ; g(int).

	% Repeat this enough times and you hit level of nesting
	% problems.  300 or so ought to be enough.
multi(1,f("string_a")).
multi(2,f("string_b")).
multi(3,f("string_c")).
multi(4,f("string_d")).
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list