intermodule optimization bug

Fergus Henderson fjh at cs.mu.OZ.AU
Mon Jan 26 07:20:51 AEDT 1998


On 09-Jan-1998, Zoltan Somogyi <zs at cs.mu.oz.au> wrote:
> 
> Found during a bootcheck, with Mmake.stage.params containing the one line
> 
> EXTRA_MCFLAGS = -O4 --intermodule-optimization
> 
> The symptom is that when in the stage 2 compiler directory, the compiler
> gets internal errors during code generation when compiling several modules,
> e.g. base_type_layout. The error is "Software error: code_util__cons_id_to_tag:
> invalid type".

The reason that code_util__cons_id_to_tag reports an error is because
the HLDS is ill-typed.  The HLDS becomes badly ill-typed after
higher_order.m, because the check for type_list_subsumes in 
construct_higher_order_terms fails (one bug is that higher_order.m
ought to call error/1 when this happens, rather than blightly
continuing... that would have reduced the time to track this down).
However, the HLDS is already ill-typed before higher_order.m,
which is why the call to type_list_subsumes fails.

The HLDS becomes ill-typed -- deliberately so -- after lambda.m,
because lambda.m reorders the arguments of higher-order terms
so that all inputs precede all outputs.  higher_order.m
ought to take that into account.  Currently it does in one place,
but not here.

So the fix is to get higher_order.m to permute the arguments
before calling type_list_subsumes.

Diff to follow sometime later, after I've had a bit of sleep ;-)

-- 
Fergus Henderson <fjh at cs.mu.oz.au>   |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>   |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3         |     -- the last words of T. S. Garp.



More information about the developers mailing list