[Bug target/28074] -mstackrealign generates inefficient code

hjl dot tools at gmail dot com gcc-bugzilla@gcc.gnu.org
Thu Jul 31 04:06:00 GMT 2008



------- Comment #6 from hjl dot tools at gmail dot com  2008-07-31 04:05 -------
With revision 138354, we got

bash-3.2$ cat /tmp/x.c
#include <emmintrin.h>

extern void bar (char *);

char *
e1 (float x, char *p)
{
  volatile __m128 dummy = _mm_set_ps1(x);
  char foo [0];
  bar (foo);
  return p;
}
bash-3.2$ ./xgcc -B./  -O2 -m32 -O -msse2 -S -mstackrealign /tmp/x.c
bash-3.2$ cat x.s
        .file   "x.c"
        .text
.globl e1
        .type   e1, @function
e1:
        pushl   %ebp
        movl    %esp, %ebp
        andl    $-16, %esp
        subl    $32, %esp
        movss   8(%ebp), %xmm0
        shufps  $0, %xmm0, %xmm0
        movlps  %xmm0, 16(%esp)
        movhps  %xmm0, 24(%esp)
        leal    16(%esp), %eax
        movl    %eax, (%esp)
        call    bar
        movl    12(%ebp), %eax
        leave
        ret
        .size   e1, .-e1

It is much nicer.


-- 

hjl dot tools at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |4.4.0
            Version|4.2.0                       |4.4.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28074



More information about the Gcc-bugs mailing list