This is the mail archive of the gcc@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]

Re: sin/cos via SSE2, and an alignment bug (was Re: sqrt via SSE2)


> On Tue, Feb 19, 2002 at 03:33:04PM +0100, Jan Hubicka wrote:
> > Can you show me the testcase?  Note that gcc does not align properly stack
> > frame of function main () in case your runtime don't.
> 
> Yes it does.
It does not, unless something changed very recently.  The patch doing trick
with alloca aligns the stack boundary, so all functions called from main are
aligned, but not main itself.
#include <xmmintrin.h>
main()
{
  __m128 t;
  return &t;
}

main:
        pushl   %ebp
        movl    %esp, %ebp
        subl    $8, %esp
        andl    $-16, %esp
        movl    %ebp, %esp
        leal    -4(%ebp), %eax
        popl    %ebp
        ret
.Lfe1:

esp gets aligned by and operation, but t is homed at stack and
computed off missaligned ebp.

Honza
> 
> 
> r~


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