[comp.compilers] Testing your optimizing compilers

eugene@pioneer.arpa (Eugene Miya N.) (05/23/87)

I was wondering about those of you who write compilers.  How do you test
your optimizing compilers to make certain 1) that optimzations are
effective, 2) the final results are identical with an unoptimized piece
of code (or at least close), 3) that you don't have dead code in your
compiler, 4) optimizations don't interact to produce "harmful
side-effects [I do not assume a Functional language]?"  Just how do you
go about testing your software?  I know you should probably use
validation suites for the more standard language compilers, but
optimization appears less frequently tested.

I know about construction from Bill Wulf's book on the subject.  One of
Wulf's students has the following nice table summarizing optimzation
techniques:

%A Samuel P. Harbison
%T A Computer Architecture for the Dynamic Optimization of High-Level
Language Programs
%R CMU-CS-80-143
%I Computer Science Dept., Carnegie-Mellon University
%D September 1980

Table 2-2 Optimization Techniques
Loop manipulations
Constant folding
Constant propagation
CSE Elimination
Code motion
Strength reduction
Register allocations
Evaluation optimizations
Access mode determination
Variable packing
Tree transformations

I would like to make this a private discussion, please write me
directly.  I will summarize only when an individual contributer gives me
authority (I'll even sign non-disclosure on this one.).  Please try to
say at least a little which I could report back to the group.


--eugene miya
  NASA Ames Research Center
  eugene@ames-aurora.ARPA
  "You trust the `reply' command with all those different mailers out there?"
  "Send mail, avoid follow-ups.  If enough, I'll summarize."
  {hplabs,hao,ihnp4,decwrl,allegra,tektronix,menlo70}!ames!aurora!eugene
[This is a fascinating question -- my experience is that optimizing compilers
are usually not well debugged.  I've run into a fair number where it turned
out that some optimizations never happened, but since the output code gave
the correct results, nobody noticed for a long time.  -John]
--
Send compilers articles to ima!compilers or, in a pinch, to Levine@YALE.ARPA
Plausible paths are { ihnp4 | decvax | cbosgd | harvard | yale | cca}!ima
Please send responses to the originator of the message -- I cannot forward
mail accidentally sent back to compilers.  Meta-mail to ima!compilers-request