gcc/gcc ChangeLog Makefile.in fixinc/Makefile. ...

Zack Weinberg zack@codesourcery.com
Wed Jul 9 14:51:00 GMT 2003


Bruce Korb <bkorb@gnu.org> writes:

> Hi Zack,
>
> I didn't see your patch for this.  There is a caveat: the unmodified
> GNU flavor of regex  insists on using its own alloca when the native
> compiler doesn't support it.  This is a problem.  It is so because
> fixincludes invokes regexec 100's of thousands of times at the same
> stack level and the alloca emulator never frees these data.  It exhausts
> all virtual memory.  So, if this ``xregex'' thing uses the same thing,
> there will be a problem.

I am not clear on the allocation pattern in regex.c, because the file
is very complicated and hides stuff behind lots of macros, but all
the match primitives are structured like this:

match()
{
  setup work
  match_internal()
#ifdef C_ALLOCA
  alloca(0);
#endif
}

Which makes me think that the problem has been solved.  I could be
wrong though.

If the problem recurs, we could just stick an alloca(0) call into the
loop in fixincludes.

zw



More information about the Gcc-patches mailing list