Mercury Bugs - mercury
View Issue Details
0000030mercuryBugpublic2007-11-28 15:292008-01-23 12:49
Assigned Tojuliensf 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0000030: break promise_equivalent_solutions
DescriptionInlining can cause the insts of variables to change from any to ground
and this, in turn, can cause erroneous error messages about promise_equivalent_solutions scopes that contain inst any variables in the scope head.

The attached test case is a cut-down version of the optimised version
of flatzinc_backend.m from the FlatZinc interpreter. This illustrates
the problem.
TagsNo tags attached.
Attached Files? equiv_solns_ia.m (1,278) 2007-11-28 15:29
? (1,624) 2007-11-28 16:50

2007-11-28 16:43   
Actually, the current version of equiv_solns_ia.m strips away too
much of the detail, and is actually an error. What is happening here
is that re-running the check on the the non-local variables in promise_equivalent_solutions scopes should not be done after inlining.
This is because after inlining the compiler may be able to infer that
some things that previously had inst any are in fact ground.

I'll add a new test case that demonstrates this.
2007-11-28 16:52   
(Last edited: 2007-12-05 15:04)
The file contains a test case that exhibits the
bug under something like the original conditions in which it occurred.

Compile with: -C -O0 --inlining --local-constraint-propagation

I think the fix here is not to perform the check on non-locals in
promise_equivalent_solutions scopes after inlining has been performed.

2008-01-23 12:49   
Fixed. See log message for r1.142 of compiler/det_report.m for details.

Issue History
2007-11-28 15:29juliensfNew Issue
2007-11-28 15:29juliensfFile Added: equiv_solns_ia.m
2007-11-28 16:43juliensfNote Added: 0000060
2007-11-28 16:50juliensfFile Added:
2007-11-28 16:52juliensfNote Added: 0000061
2007-12-05 15:04juliensfNote Edited: 0000061
2008-01-23 12:49juliensfStatusnew => resolved
2008-01-23 12:49juliensfResolutionopen => fixed
2008-01-23 12:49juliensfAssigned To => juliensf
2008-01-23 12:49juliensfNote Added: 0000072