[MLton] fixing -codegen c -profile time for the release

Matthew Fluet fluet@cs.cornell.edu
Wed, 16 Nov 2005 09:33:01 -0500 (EST)

>> It seems to me that the ideal fix is to figure out how to tell GCC
>> exactly what we want, without inhibiting its optimization as much as
>> possible.  Unfortunately, as far as I can tell, no one has even
>> proposed a way to do the former, let alone while simultaneously
>> achieving the latter (in fact, this seems impossible).
> I am not sure I fully understand .. but I believe I know
> how to do this -- because Felix is already doing it.
> So is Mercury .. which is where I stole it from.
> The idea is explained in Fergus Henderson (et al)'s paper:
> http://felix.sourceforge.net/papers/mercury_to_c.ps
> and involves inserting 'Assembler Labels' into the code
> in such a way they cannot be elided.

This is precisely the mechanism that we have been using.  The problem is 
not preventing gcc from eliding the assembler labels, it is preventing gcc 
from duplicating the labels.  Felix will suffer from exactly the same 
problem that MLton is facing if gcc decides to duplicate a block that 
makes use of the FLX_LABEL macro.