[m-dev.] --warn-non-tail-recursion and deep profiling

Paul Bone paul at bone.id.au
Wed Mar 2 11:52:34 AEDT 2016

On Wed, Mar 02, 2016 at 10:13:24AM +1100, Julien Fischer wrote:
> Hi,
> Was it intended that --warn-non-tail-recursion should emit warnings
> in deep profiling grades?  Since those grades disable tail recursion
> you obviously get a warning about every recursive predicate.

Not specifically.

Because this is disabled by default simply enabling deep profiling won't
cause these warnings.  A user giving both options on the command line will
very quickly figure out what is happening, but if --warn-non-tail-recursion
is specified in a Mercury.options file, especially if it's setup by another
developer on a team, then enabling --deep-profiling might cause some
surprise.  I think that the question is: which surprise is better?  Lots of
warnings or running out of stack space.  Does the answer to this change if
we take away the historical behaviour of breaking tail recursion in deep
profiling grades?

Paul Bone

More information about the developers mailing list