[m-rev.] For review: Fix bug 180

Paul Bone pbone at csse.unimelb.edu.au
Thu Feb 3 23:49:07 AEDT 2011


On Thu, Feb 03, 2011 at 09:14:28PM +1100, Julien Fischer wrote:
> 
> On Thu, 3 Feb 2011, Paul Bone wrote:
> 
> >Branches: main 11.01
> >
> >Fix bug180.
> >
> >bug180's symptom was a crash in the code generator when compiling ssdb/ssdb.m
> >with inlining in a deep-profiling grade.
> >
> >The pre-profiling simplify transformation can introduce new variables and did
> >not update the varset in the proc_info structure, but did add new entries to
> >the vartypes map.  Then when the deep-profiling transformation executes it
> >allocates it's own new variables using an old varset, causing it to clobber
> >existing entries in the vartypes array.  This means that variables created by
> >the simplification transformation that are referenced by goals are now
> >clobbered by the deep-profiler variables
> >
> >tests/valid/bug180.m:
> >tests/valid/bug180_mdb.m:
> >tests/valid/Mmakefile:
> >tests/valid/Mercury.options:
> >   Add a regression test for bug180 to the test suite.
> >
> >compiler/simplify.m:
> >   Fix bug180 by always updating the proc_info's varset.
> >
> >compiler/deep_profiling.m:
> >   Use svmap.det_insert rather than svmap.set to detect these types of errors
> >   earlier.
> >
> >compiler/handle_options.m:
> >   Add a new dump hlds alias to help debug variable-related problems.
> 
> The bug-fix itself is fine.  I recommend trying to cut down the size of
> the regression test though.
> 

I did, I had trouble since it relies on inlining.

I'll try again now that I understand the cause of the bug.

Thanks.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: Digital signature
URL: <http://lists.mercurylang.org/archives/reviews/attachments/20110203/de56b40e/attachment.sig>


More information about the reviews mailing list