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/55774] New: AVX integer store segfault


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

             Bug #: 55774
           Summary: AVX integer store segfault
    Classification: Unclassified
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: target
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: gcc-bugzilla@ben-strasser.net


The following code segfaults

#include <immintrin.h>

int main(){
    unsigned a[8] = {0x22222222u, 0xAAAAAAAAu, 0x11111111u, 0x33333333u,
0xDEADBEAFu, 0xFAAAAAAAu, 0xDEADBEAFu, 0xFAAAAAAAu};
    unsigned b[8];

    __m256i x = _mm256_load_si256((__m256i*)a);
    _mm256_store_si256((__m256i*)b, x);
}

when compiled with 

g++ -mavx mini.cpp -o mini && ./mini

The output of g++ -S is

    .file    "mini.cpp"
    .text
    .globl    main
    .type    main, @function
main:
.LFB707:
    .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    $40, %rsp
    movl    $572662306, -40(%rsp)
    movl    $-1431655766, -36(%rsp)
    movl    $286331153, -32(%rsp)
    movl    $858993459, -28(%rsp)
    movl    $-559038801, -24(%rsp)
    movl    $-89478486, -20(%rsp)
    movl    $-559038801, -16(%rsp)
    movl    $-89478486, -12(%rsp)
    leaq    -40(%rsp), %rax
    movq    %rax, 24(%rsp)
    movq    24(%rsp), %rax
    vmovdqa    (%rax), %ymm0
    vmovdqa    %ymm0, -120(%rsp)
    leaq    -8(%rsp), %rax
    movq    %rax, 32(%rsp)
    vmovdqa    -120(%rsp), %ymm0
    vmovdqa    %ymm0, -88(%rsp)
    movq    32(%rsp), %rax
    vmovdqa    -88(%rsp), %ymm0
    vmovdqa    %ymm0, (%rax)
    movl    $0, %eax
    leave
    .cfi_def_cfa 7, 8
    ret
    .cfi_endproc
.LFE707:
    .size    main, .-main
    .ident    "GCC: (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3"
    .section    .note.GNU-stack,"",@progbits




My GCC version is: g++ (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3


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