[m-dev.] bug fixes for module qualified cons_ids

Fergus Henderson fjh at cs.mu.oz.au
Tue Apr 1 22:41:00 AEST 1997


Simon TAYLOR, you wrote:
> 
> > > +		{ pred_info_get_marker_list(PredInfo0, Markers) },
> > >  		(
> > >  			% Don't export builtins since they will be
> > >  			% recreated in the importing module anyway.
> > >  			{ \+ code_util__compiler_generated(PredInfo0) },
> > >  			{ \+ code_util__predinfo_is_builtin(PredInfo0) },
> > > +				% The compiler may have difficulty parsing
> > > +				% inferred modes due to $typed_inst etc.
> > > +			{ \+ list__member(request(infer_modes), Markers) },
> > 
> > Also, that change is not an acceptable solution, IMHO.
> > The compiler should not give up on intermodule optimization
> > just because you haven't declared the modes.
> 
> Currently the `.opt' files are written out immediately after type-checking,
> so mode inference cannot be supported without running mode analysis as well.
> Is the extra compilation time worth it? Actually, the check added here
> is unnecessary, since exported predicates must have modes declared, so I've
> removed it.

Uh, I think that is wrong.  Predicates that are not exported may still
get put in the `.opt' file, if they are called by exported predicates.
So, unless I am mistaken, that removal is a bug.  Please scrap my previous
"That looks fine" comment; you should fix this bug before committing this
stuff.

Is the extra compilation time worth it?  Well, if you've enabled
`--intermod-unused-args', then you're going to spend that time anyway.
So at least in that case, yes it is worth it.

(So we should fix this.  But the fix can be a separate change, i.e.
I'm not asking you to fix it in this particular cvs commit.)

> > How come it writes the `.opt' file *before* invoking the front-end
> > passes and polymorphism?  Shouldn't it write the `.opt' file last?
> 
> Having polymorphism stuff in the `.opt' file would complicate reading
> the `.opt' files back in. Mode and determinism analysis and polymorphism 
> are only run here because unused_args needs the information.

Yes, but what is the point of running the unused_args pass, if the `.opt'
file has already been written out?  Where does the information in the
unused_args pass get saved?  It looks to me like it just gets discarded,
i.e. the --intermod-unused-args option doesn't work.

(That looks to me like another bug, but this is an unrelated issue
and so this bug, if it is a bug, should be fixed in a different
cvs commit.)

Cheers,
	Fergus.

-- 
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