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 target/49001] GCC uses VMOVAPS/PD AVX instructions to access stack variables that are not 32-byte aligned


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

Uros Bizjak <ubizjak at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ktietz at gcc dot gnu.org
           Severity|critical                    |normal

--- Comment #1 from Uros Bizjak <ubizjak at gmail dot com> 2011-05-15 18:49:44 UTC ---
(In reply to comment #0)
> I'm using a custom mingw64 build of GCC 4.6.1. My target is Windows 64bit. I
> compile with g++ -03 -march=corei7-avx -mtune=corei7-avx -mavx.

Please provide testcase that can be compiled without changes. See [1].

FWIW, I have tested following testcase on x86_64-pc-linux-gnu:

--cut here--
#include <x86intrin.h>

__m256 sin256_ps_avx (__m256);

__m256 dummy_ps256;
void test_stackalign32() {
    volatile __m256 x = dummy_ps256;
    dummy_ps256 = sin256_ps_avx(x);
}
--cut here--

And got expected code (gcc-4.6.1):

test_stackalign32:
.LFB828:
    .cfi_startproc
    pushq    %rbp
    .cfi_def_cfa_offset 16
    .cfi_offset 6, -16
    movq    %rsp, %rbp
    .cfi_def_cfa_register 6
    andq    $-32, %rsp
    subq    $32, %rsp
    vmovaps    dummy_ps256(%rip), %ymm0
    vmovaps    %ymm0, (%rsp)
    vmovaps    (%rsp), %ymm0
    call    sin256_ps_avx
    vmovaps    %ymm0, dummy_ps256(%rip)
    leave
    .cfi_def_cfa 7, 8
    vzeroupper
    ret

Probably mingw64 specific problem... CC added.

[1] http://gcc.gnu.org/bugs/#report


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