From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17952 invoked by alias); 10 Sep 2013 14:52:33 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 17931 invoked by uid 48); 10 Sep 2013 14:52:30 -0000 From: "martin at netbsd dot org" To: gcc-bugs@gcc.gnu.org Subject: [Bug preprocessor/58381] crash in diagnostic_report_current_module when a fatal_error happens during PCH processing on NetBSD/spa64rc Date: Tue, 10 Sep 2013 14:52:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: preprocessor X-Bugzilla-Version: 4.8.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: martin at netbsd dot org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2013-09/txt/msg00725.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58381 --- Comment #1 from Martin Husemann --- The global pointer "line_table" is changed to the contents of the precompiled header file in gt_pch_restore in this loop: /* Read in all the global pointers, in 6 easy loops. */ for (rt = gt_ggc_rtab; *rt; rt++) for (rti = *rt; rti->base != NULL; rti++) for (i = 0; i < rti->nelt; i++) if (fread ((char *)rti->base + rti->stride * i, sizeof (void *), 1, f) != 1) fatal_error ("can%'t read PCH file: %m"); but not reset to the previous values when the compiler decides to not use the pch contents (for example because the address of the mmap differs). We probably need to save at least line_table (and maybe input_location) at the start of this function and restore it before invoking fatal_error.