[MLton-user] experimental release 20051109

Florian Weimer fw@deneb.enyo.de
Mon, 14 Nov 2005 09:57:26 +0100


* Matthew Fluet:

> A little more investigation reveals that -fno-tree-ch suffices to quell 
> the errors.  The gcc documentation describes the tree-ch optimization as 
> follows:
>
>   Perform loop header copying on trees. This is beneficial since it
>   increases effectiveness of code motion optimizations. It also saves one
>   jump. This flag is enabled by default at -O and higher. It is not
>   enabled for -Os, since it usually increases code size.
>
> This agrees with the observed behavior: a loops in SML are almost 
> invariably defined by recursive functions, hence would receive a 
> distinguished profiling label.  MLton successfully translates the 
> recursive function into a local loop, with the profiling label in the loop 
> (including the header).  Duplicating the header duplicates the profile 
> label.

Looks like a bug in should_duplicate_loop_header_p; it should not flag
volatile asm statements for duplication.  However, this is a corner
case because duplication of volatile asm statements usually does not
hurt, as long as only one duplicate is ever executed.

I will check with the GCC folks.