From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2363 invoked by alias); 22 Dec 2004 18:16:59 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 1517 invoked by alias); 22 Dec 2004 18:16:22 -0000 Date: Wed, 22 Dec 2004 18:16:00 -0000 Message-ID: <20041222181622.1515.qmail@sourceware.org> From: "rguenth at tat dot physik dot uni-tuebingen dot de" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20041222143844.19131.rguenth@tat.physik.uni-tuebingen.de> References: <20041222143844.19131.rguenth@tat.physik.uni-tuebingen.de> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug target/19131] alloca returning unnecessarily aligned pointer and uses too much memory X-Bugzilla-Reason: CC X-SW-Source: 2004-12/txt/msg03246.txt.bz2 List-Id: ------- 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