This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/50938] x86 alloca adds 15 twice
- From: "ppluzhnikov at google dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 31 Oct 2011 17:43:50 +0000
- Subject: [Bug rtl-optimization/50938] x86 alloca adds 15 twice
- Auto-submitted: auto-generated
- References: <bug-50938-4@http.gcc.gnu.org/bugzilla/>
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.