This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Testcase minimization with Delta



On Sat, 16 Nov 2002, Daniel Berlin wrote:

> 
> 
> On Sat, 16 Nov 2002, Zack Weinberg wrote:
> 
> > Daniel Berlin <dberlin@dberlin.org> writes:
> > 
> > > I found a neat program that can do testcase minimization for GCC.
> > > It's a bit slow in it's current form, but this is from execing gcc, AFAICT. If 
> > > someone rewrote it in C (not difficult, there are python and perl 
> > > implementations of the algorithm it uses, and it's fairly straightforward)  
> > > so that it could be linked with gcc itself, we could have an automatic 
> > > test case minimizer program.
> > 
> > I tried this out on a messy test case (spline.ii from PR 8511).  It
> > did a nice job of reducing the original test case from 32,000 lines
> > down to 5,000 -- but getting it smaller than that rapidly hit
> > diminishing returns.  In the end it hit a wall at about 1000 lines; I
> > was able to take that and cut it down by hand to 44 lines.  I think
> > much of this is because it only knows how to do deletions, not
> > substitutions or reorderings; but it was also remarkably bad at
> > catching huge chunks that were unnecessary (deletions that were
> > obvious to a human).  This could no doubt be improved if it had some
> > knowledge of the structure of a C++ program.
> 
> You didn't run topformflat on the program, did you?
topformflat, in case you didn't notice, will flatten the program to 
whatever level (IE it makes it so line breaks are only allowed at certain 
level.  Thus, flattening to level 0 will make each function a single 
line.).

Thus, you start at level 0 (where you end up with a lot smaller number of 
lines), run the minimizer, then increase the level gradually, and repeat 
until you are happy with how small the testcase is.

Minimizing 32000 lines directly would be incredibly slow, and not very 
practical.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]