http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50938
Paul Pluzhnikov <ppluzhnikov at google dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |ppluzhnikov at google dot
| |com
--- Comment #1 from Paul Pluzhnikov <ppluzhnikov at google dot com> 2011-10-31
17:43:50 UTC ---
This bug prevent glibc's extend_alloca from working as it is intended.
The macro (for _STACK_GROWS_DOWN) is:
# define extend_alloca(buf, len, newlen) \
(__typeof (buf)) ({ size_t __newlen = (newlen); \
char *__newbuf = __alloca (__newlen); \
if (__newbuf + __newlen == (char *) buf) \
len += __newlen; \
else \
len = __newlen; \
__newbuf; })
However due to the +30 adjustment, __newbuf + __newlen == (char *) buf is never
true.
This leads to excessive stack use in glibc under some conditions.