From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19049 invoked by alias); 21 Sep 2014 01:08:25 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 19017 invoked by uid 55); 21 Sep 2014 01:08:20 -0000 From: "rcopley at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/54412] Request for 32-byte stack alignment with -mavx on Windows Date: Sun, 21 Sep 2014 01:08:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 4.7.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: rcopley at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-09/txt/msg02018.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54412 --- Comment #11 from R Copley --- On 20 September 2014 07:08, roland at rschulz dot eu wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54412 > > --- Comment #10 from Roland Schulz --- > Created attachment 33520 > --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33520&action=edit > Slightly modified testcase > > This slightly modified testcase in which the return value isn't stored, still > segfaults for me. With the 32bit mingw64 binary ((i686-win32-dwarf-rev1, Built > by MinGW-W64 project) 4.9.1) it is OK, but with the 64bit binary > ((x86_64-win32-seh-rev1, Built by MinGW-W64 project) 4.9.1) it segfaults. Confirmed (with the same compiler, in the mingw-builds toolchain). I compiled your testcase with command "gcc -O0 -g -ggdb -m64 -mavx bug.c". It segfaults on the instruction marked "=>" below. (gdb) disassemble /m Dump of assembler code for function f: 6 { 0x00000000004014f0 <+0>: push %rbp 0x00000000004014f1 <+1>: mov %rsp,%rbp 0x00000000004014f4 <+4>: mov %rcx,0x10(%rbp) 0x00000000004014f8 <+8>: sub $0x40,%rsp 0x00000000004014fc <+12>: mov %rsp,%rax 0x00000000004014ff <+15>: add $0x1f,%rax 0x0000000000401503 <+19>: shr $0x5,%rax 0x0000000000401507 <+23>: shl $0x5,%rax 7 v4d x __attribute__ ((aligned (32))) = { 1.0, 2.0, 3.0, 4.0, }; 0x000000000040150b <+27>: vmovapd 0x2aed(%rip),%ymm0 # 0x404000 0x0000000000401513 <+35>: vmovapd %ymm0,(%rax) 8 return x; 0x0000000000401517 <+39>: mov 0x10(%rbp),%rdx 0x000000000040151b <+43>: vmovapd (%rax),%ymm0 => 0x000000000040151f <+47>: vmovapd %ymm0,(%rdx) 9 } 0x0000000000401523 <+51>: mov 0x10(%rbp),%rax 0x0000000000401527 <+55>: mov %rbp,%rsp 0x000000000040152a <+58>: pop %rbp 0x000000000040152b <+59>: retq End of assembler dump. (gdb) print $rdx % 32 $1 = 16