This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: C++ lexical analysis rework
- From: Eric Botcazou <ebotcazou at libertysurf dot fr>
- To: Zack Weinberg <zack at codesourcery dot com>
- Cc: gcc-patches at gcc dot gnu dot org,Matt Austern <matt at lafstern dot org>,Steve Naroff <snaroff at apple dot com>
- Date: Sat, 15 Jan 2005 10:50:05 +0100
- Subject: Re: C++ lexical analysis rework
- References: <871xgw4azp.fsf@codesourcery.com>
> Here is the foreshadowed patch which speeds up the C++ front end's
> lexical analysis phase. What it does is really quite simple: it has
> (almost) all of the work that cpplib and c-lex.c do done at once, and
> holds all the translation unit's tokens in a big buffer.
I just discovered that this breaks DBX_USE_BINCL support:
3.4.x:
.stabs "wchar-1.H",130,0,0,0
.stabs "/home/eric/install/gcc-3_4-branch/native/lib/gcc/amd64-mandrake-linux-gnu/3.4.4/include/stddef.h",130,0,0,0
.stabs "ptrdiff_t:t(2,1)=(0,3)",128,0,0,0
.stabs "size_t:t(2,2)=(0,17)",128,0,0,0
.stabn 162,0,0,0
.stabn 162,0,0,0
4.0.0
.stabs "ptrdiff_t:t(0,25)=(0,7)",128,0,0,0
.stabs "size_t:t(0,26)=(0,9)",128,0,0,0
because dbxout.c relies on the ordered invocations of
dbxout_start_source_file, dbxout_symbol and dbxout_end_source_file to
implement it. Now dbxout_start_source_file and dbxout_end_source_file are
invoked by the lexer, while dbxout_symbol is invoked by the parser.
The problem shows up through these failures in the C++ testsuite:
FAIL: g++.dg/pch/externc-1.C -g assembly comparison
FAIL: g++.dg/pch/externc-1.C -O2 -g assembly comparison
FAIL: g++.dg/pch/static-1.C -g assembly comparison
FAIL: g++.dg/pch/static-1.C -O2 -g assembly comparison
FAIL: g++.dg/pch/system-1.C -g assembly comparison
FAIL: g++.dg/pch/system-1.C -O2 -g assembly comparison
FAIL: g++.dg/pch/system-2.C -g assembly comparison
FAIL: g++.dg/pch/system-2.C -O2 -g assembly comparison
FAIL: g++.dg/pch/uninst.C -g assembly comparison
FAIL: g++.dg/pch/uninst.C -O2 -g assembly comparison
FAIL: g++.dg/pch/wchar-1.C -g assembly comparison
FAIL: g++.dg/pch/wchar-1.C -O2 -g assembly comparison
on e.g. sparc-sun-solaris2.6 and sparc-sun-solaris2.5.1.
How do you think we can fix this? Should we "replay" the opening/closing of
files in the parser (if this is ever possible)?
--
Eric Botcazou