Hi everyone,

 I developed an aid to help me debug the peephole optimizer a while ago,
and I would like to present it as a possible permanent fixture to the
compiler if it is built with a particular define (DEBUG_ASMOUTPUT) - what
it does... during each pass of the peephole optimizer under i386 or x86_64
(the only platforms that currently have implementations - other platforms
won't do anything), the assembly of the current block is dumped to the
console in a colour-coded fashion for ease of identification.

 It's not something you would normally build the compiler with, since the
console dump significantly increases the compilation time of a project, but
if you have the compiler open in a debugger, say, it allows you to see what
the peephole optimizer is working on if you put a breakpoint at the
beginning of the loop, say.  That way, you can see how the peephole
optimiser has modified the code and thus more easily identify bugs when
refactoring routines or adding new features.  I myself have been using it
to help with debugging my optimizer overhaul project.

 Details can be found here: https://bugs.freepascal.org/view.php?id=34642
 Gareth aka. Kit
  
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply via email to