This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/14205] New: ICE with -M and -include
- From: "1319 at bot dot ru" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 19 Feb 2004 00:06:10 -0000
- Subject: [Bug c/14205] New: ICE with -M and -include
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
When gcc invoked with -M and -include it segfaults on any input files. This
problem happens with c++ also. Easiest way to turn this bug on is:
$ touch file.c file.h
$ gcc -M -include file.h file.c
file.c:0: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
$
or, easier to debug:
$ cc1 -E -M -include file.h file.c
with same result.
It is at line 70 in c-ppoutput.c: (gcc 3.4.0 20040218)
61:/* Preprocess and output. */
62:void
63:preprocess_file (cpp_reader *pfile)
64:{
65: /* A successful cpp_read_main_file guarantees that we can call
66: cpp_scan_nooutput or cpp_get_token next. */
67: if (flag_no_output)
68: {
69: /* Scan -included buffers, then the main file. */
70: while (pfile->buffer->prev)
80: cpp_scan_nooutput (pfile);
90: cpp_scan_nooutput (pfile);
91: }
here pfile->buffer == 0.
--
Summary: ICE with -M and -include
Product: gcc
Version: 3.4.0
Status: UNCONFIRMED
Severity: critical
Priority: P1
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: 1319 at bot dot ru
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14205