From 047c6eac118070bdaa0650bbcc3f704a79615280 Mon Sep 17 00:00:00 2001 From: Geoffrey Keating Date: Fri, 7 Nov 2003 22:12:39 +0000 Subject: [PATCH] re PR pch/11654 (incorrect stabs when using pre-compiled headers) PR 11654 * dbxout.c (struct dbx_file): Do not save for PCH. (current_file): Likewise. (dbxout_init): Don't allocate struct dbx_file using GC. (dbxout_start_source_file): Likewise. From-SVN: r73346 --- gcc/ChangeLog | 8 ++++++++ gcc/dbxout.c | 22 ++++++++++++++-------- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f658db5aabe..80f1b5f5dc2 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2003-11-07 Geoffrey Keating + + PR 11654 + * dbxout.c (struct dbx_file): Do not save for PCH. + (current_file): Likewise. + (dbxout_init): Don't allocate struct dbx_file using GC. + (dbxout_start_source_file): Likewise. + 2003-11-07 Falk Hueffner * config/alpha/elf.h, config/alpha/unicosmk.h, diff --git a/gcc/dbxout.c b/gcc/dbxout.c index ef04c831134..e6b2c880f17 100644 --- a/gcc/dbxout.c +++ b/gcc/dbxout.c @@ -185,19 +185,25 @@ enum binclstatus {BINCL_NOT_REQUIRED, BINCL_PENDING, BINCL_PROCESSED}; pair of the file number and the type number within the file. This is a stack of input files. */ -struct dbx_file GTY(()) +struct dbx_file { struct dbx_file *next; int file_number; int next_type_number; - enum binclstatus bincl_status; /* Keep track of lazy bincl. */ - const char *pending_bincl_name; /* Name of bincl. */ - struct dbx_file *prev; /* Chain to traverse all pending bincls. */ + enum binclstatus bincl_status; /* Keep track of lazy bincl. */ + const char *pending_bincl_name; /* Name of bincl. */ + struct dbx_file *prev; /* Chain to traverse all pending bincls. */ }; -/* This is the top of the stack. */ +/* This is the top of the stack. + + This is not saved for PCH, because restoring a PCH should not change it. + next_file_number does have to be saved, because the PCH may use some + file numbers; however, just before restoring a PCH, next_file_number + should always be 0 because we should not have needed any file numbers + yet. */ -static GTY(()) struct dbx_file *current_file; +static struct dbx_file *current_file; /* This is the next file number to use. */ @@ -513,7 +519,7 @@ dbxout_init (const char *input_file_name) next_type_number = 1; #ifdef DBX_USE_BINCL - current_file = ggc_alloc (sizeof *current_file); + current_file = xmalloc (sizeof *current_file); current_file->next = NULL; current_file->file_number = 0; current_file->next_type_number = 1; @@ -625,7 +631,7 @@ dbxout_start_source_file (unsigned int line ATTRIBUTE_UNUSED, const char *filename ATTRIBUTE_UNUSED) { #ifdef DBX_USE_BINCL - struct dbx_file *n = ggc_alloc (sizeof *n); + struct dbx_file *n = xmalloc (sizeof *n); n->next = current_file; n->next_type_number = 1;