This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug preprocessor/11178] New: preprocessor calls abort on -CC -traditional-cpp
- From: "cato at df dot lth dot se" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 12 Jun 2003 20:04:52 -0000
- Subject: [Bug preprocessor/11178] New: preprocessor calls abort on -CC -traditional-cpp
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11178
Summary: preprocessor calls abort on -CC -traditional-cpp
Product: gcc
Version: 3.4
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: preprocessor
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: cato@df.lth.se
CC: gcc-bugs@gcc.gnu.org
GCC build triplet: i386-unknown-netbsdelf1.6
GCC host triplet: i386-unknown-netbsdelf1.6
GCC target triplet: i386-unknown-netbsdelf1.6
The changes to gcc.dg/cpp/trad/maccom4.c and gcc.dg/cpp/trad/maccom6.c on June 2
uncovered a latent bug in the preprocessor that makes these tests fail on
NetBSD/FreeBSD/OpenBSD (but curiously, other systems seems not to be affected as
seen from gcc-testresults...)
What happens (at least on i386-unknown-netbsdelf1.6) is that abort() is called
in _cpp_process_line_notes(). That in turn seems to be due to note->pos <
buffer->cur so that the loop is not broken out of.
Hypothesis: There is a big difference between those pointers, so it looks to me
like they have been allocated from different calls to malloc() (or on pointer
has been realloc:ed, and the other one not adjusted). Difference between
implementations of malloc with friends may explain why they fail for *BSD
only...
(I do not have time to learn the code right now, but I'm happy to do some
investigations/tests if my bug report rings a bell for someone...)