This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug rtl-optimization/50938] x86 alloca adds 15 twice


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]