This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Technique for finding regressions in the C++ parser
- From: Craig Rodrigues <rodrigc at attbi dot com>
- To: gcc at gcc dot gnu dot org
- Date: Fri, 29 Nov 2002 21:34:16 -0500
- Subject: Technique for finding regressions in the C++ parser
Hi,
I'm very interested in C++ support in GCC, so I try
to help where I can by isolating C++ bugs once in a while.
C++ seems like an insane language for a compiler writer. :)
This technique may seem very obvious to those of
you more familiar with GCC, but I just stumbled across
it in the past few days, and it seems to work.
The methodology involves:
(1) For a piece of code which causes a compiler Internal
Compiler Error (ICE), get preprocessed source
with the -save-temps flag, or create a small reproduceable
testcase. Volker Reichelt and Wolfgang Bangerth
seem pretty good at creating small testcases.
(2) Check out gcc from the read-only CVS repository with the CVSROOT
:pserver:anoncvs@subversions.gnu.org:/cvsroot/gcc
(be kind to developers who use the read/write repository)
according to the instructions at http://gcc.gnu.org/cvs.html
(3) Follow the instructions to configure GCC at:
http://gcc.gnu.org/install/configure.html
(4) Instead of following the full bootstrap procedure, do the following:
cd objdir
make all-libiberty
cd gcc
make cc1plus
This will build libiberty and cc1plus. When you have cc1plus, you
can feed your source code snippet to it:
cc1plus -quiet testcase.ii
You can repeat steps (2)-(4), but use the cvs co -D [DATE] to check out
a version of GCC from a different date. You can then do:
cvs diff -D [DATE1] -D [DATE2] [file]
to find out what changes occured on a file or directory.
If you have a fast machine, and a fast net connection, then this
process goes by quickly. :)
It's pretty brute force, but the alternative is for me to learn how
to write a C++ compiler. ;)
Thanks, GCC crew, for a great piece of software!
--
Craig Rodrigues
http://www.gis.net/~craigr
rodrigc@attbi.com