+++ This bug was initially created as a clone of Bug #13675 +++ The error occurs when using a precompiled header which was compiled with -g3. It works with -g2. The error message is "file number 2 already allocated".
This was first reported at Bug #13675 comment #16 by lukas, but it seems to me that this bug is unrelated to that one, so I'm reporting it again here. This is how to reproduce it: $ cat header1.h $ cat header2.h #include "header1.h" $ cat test.cpp #include "header2.h" main() {} $ g++ -c -g3 -o header1.h.gch header1.h $ g++ -c -g3 test.cpp /tmp/ccPfw5P5.s: Assembler messages: /tmp/ccPfw5P5.s:445: Error: file number 2 already allocated -v reports the following: GNU C++ (GCC) version 4.4.0 (x86_64-unknown-linux-gnu) compiled by GNU C version 4.4.0, GMP version 4.1.4, MPFR version 2.3.2. GNU assembler version 2.19 (x86_64-unknown-linux-gnu) using BFD version (GNU Binutils) 2.19 /tmp/ccfJxSqk.s: Assembler messages: /tmp/ccfJxSqk.s:445: Error: file number 2 already allocated -- Summary: error using precompiled headers with extra debug info (- g3) Product: gcc Version: 4.4.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: pch AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: gafunchal at gmail dot com GCC build triplet: x86_64-unknown-linux-gnu GCC host triplet: x86_64-unknown-linux-gnu GCC target triplet: x86_64-unknown-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40272