public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenth at tat dot physik dot uni-tuebingen dot de" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/19131] alloca returning unnecessarily aligned pointer and uses too much memory
Date: Wed, 22 Dec 2004 18:16:00 -0000 [thread overview]
Message-ID: <20041222181622.1515.qmail@sourceware.org> (raw)
In-Reply-To: <20041222143844.19131.rguenth@tat.physik.uni-tuebingen.de>
------- Additional Comments From rguenth at tat dot physik dot uni-tuebingen dot de 2004-12-22 18:16 -------
Subject: Re: alloca returning unnecessarily aligned pointer
and uses too much memory
pinskia at gcc dot gnu dot org wrote:
> ------- Additional Comments From pinskia at gcc dot gnu dot org 2004-12-22 15:06 -------
> The reason you cannot find anything in the C standard is because this is ABI thing so this is invalid
>
> We need to keep the stack aligned sorry.
Inside a function!? Or just at function callsites? Humm, the Intel
compiler produces
..B1.3: # Preds ..B1.2 ..B1.4
movl $4, %eax #5.12
subl %eax, %esp #5.12
andl $-16, %esp #5.12
movl %esp, %eax #5.12
# LOE eax ebx ebp esi edi
..B1.4: # Preds ..B1.3
addl (%eax), %ebx #6.3
addl $1, %esi #4.21
cmpl %edi, %esi #4.2
jl ..B1.3
which looks like it aligns the stack after alloca, but it manages to
waste less space by subtracting $4, not $32.
Also if the ABI says the stack is aligned, why do we not make use of
this and avoid the andl $-16, %esp -- or is the alignment only about
alloca?
I'm a bit confused.
Richard.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19131
next prev parent reply other threads:[~2004-12-22 18:16 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-12-22 14:39 [Bug tree-optimization/19131] New: " rguenth at tat dot physik dot uni-tuebingen dot de
2004-12-22 15:06 ` [Bug target/19131] " pinskia at gcc dot gnu dot org
2004-12-22 18:16 ` rguenth at tat dot physik dot uni-tuebingen dot de [this message]
2004-12-23 22:23 ` rguenth at tat dot physik dot uni-tuebingen dot de
2004-12-23 22:27 ` Jan Hubicka
2004-12-23 22:27 ` hubicka at ucw dot cz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20041222181622.1515.qmail@sourceware.org \
--to=gcc-bugzilla@gcc.gnu.org \
--cc=gcc-bugs@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).