Comment 11 for bug 172326

Revision history for this message
In , Joseph-codesourcery (joseph-codesourcery) wrote :

Subject: Re: gcc segfaults on very long pointer chains

On Fri, 4 May 2007, bangerth at dealii dot org wrote:

> But seriously, while I do think that we should strive to compile even
> programs that are "weird" or "unusual" in their requirements on the
> compiler, I think that this one goes a little overboard. I would,
> however, be interested to hear how many levels of pointers gcc
> actually *can* compile. I would imagine it's at least a few
> hundred, maybe thousand. Maybe you could try to figure out?

That would depend on your stack limit (so the question would really be,
for each extra MB of stack limit how many more levels can it compile)?
For such extreme programs I think it's reasonable to expect users to
increase their stack limit when running the compiler.

Although in this case, it would be reasonably straightforward to make
c_parser_declarator iterative (with an internal linked list on the parser
obstack) rather than recursive - if that were actually of use in compiling
real code with real stack limits.