[gambit-list] '-expansion' code doesn't match .c file

Marc Feeley feeley at iro.umontreal.ca
Thu Nov 17 21:26:41 EST 2011


On 2011-11-17, at 3:02 PM, Bradley Lucier wrote:

> It's OK with me that the compiler removes this code; what I find troubling is that it's still in the "expansion" of the scheme code---it appears that there are optimizations done after the expansion but before code generation.
> 
> I'd like to rely on the output of '-expansion' more and to rely on reading the C code (or the resulting assembly code in extreme cases) less in trying to figure out how gsc will compile my code.
> 
> Can the '-expansion' be emitted later in the compilation process, after all code-visible optimizations have been made?

These optimizations are done in _front.scm after the source-to-source rewrites in _ptree[12].scm .  So there is no moment in time where the AST represents these optimizations.  Moving these optimizations to _ptree[12].scm is conceivable but would require a fair amount of refactoring.

Marc




More information about the Gambit-list mailing list