This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: gcc reports Internal Error
- From: Zack Weinberg <zack at codesourcery dot com>
- To: Stuart MacDonald <stuartm at connecttech dot com>
- Cc: gnu-gcc-bug at gnu dot org
- Date: Thu, 11 Jul 2002 16:03:57 -0700
- Subject: Re: gcc reports Internal Error
- References: <3d2df17b$1@news.sentex.net>
On Thu, Jul 11, 2002 at 05:00:13PM -0400, Stuart MacDonald wrote:
> Here's the error text:
>
> gcc: Internal error: Terminated (program cpp0)
> Please submit a full bug report.
> See URL:http://bugzilla.redhat.com/bugzilla/ for instructions.
>
> Here's the story:
>
> A little while ago I needed to find out what all the predefined macros
> were for a compiler (not gcc). After some web research I came across
> a program called 'defines' that did a quick search. Its main technique
> is to build a C file with probable macros, and preprocess it and see
> what happens.
For GCC, a much more efficient technique is to make use of the -dM
option. See the manual.
...
> This turns out to be a fair amount of data. Rather than write it all
> to a file, I
>
> # bfdefines 4 | gcc -E - > results
>
> This is when the error happens. It seems (from watching sar) that gcc
> runs out of memory as well.
>
> I'm guessing that gcc has a built-in limit on how big a file it can
> compile/preprocess, but nowhere can I find what that limit is. Is this
> what is happening, or is an actual bug in the compiler?
GCC attempts to read the entire file into memory before processing it.
This may change in the future, but has not been a problem for normal
use so far. Presumably, your program generates more data than will
fit in memory at once.
> A related question that I couldn't find an answer for: what's the
> largest macro name size (in terms of string length) supported by gcc?
UINT_MAX characters, normally 2^32 - 1 (even on 64-bit systems);
however, most people do not have enough memory to store a
four-gigabyte identifier.
zw