public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/110273] New: i686-w64-mingw32 with -march=znver4 generates AVX instructions without stack alignment
@ 2023-06-15 21:53 zfigura at codeweavers dot com
  2023-06-15 21:54 ` [Bug target/110273] " zfigura at codeweavers dot com
                   ` (16 more replies)
  0 siblings, 17 replies; 18+ messages in thread
From: zfigura at codeweavers dot com @ 2023-06-15 21:53 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110273

            Bug ID: 110273
           Summary: i686-w64-mingw32 with -march=znver4 generates AVX
                    instructions without stack alignment
           Product: gcc
           Version: 13.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zfigura at codeweavers dot com
                CC: amonakov at gcc dot gnu.org
  Target Milestone: ---

Created attachment 55334
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55334&action=edit
offending source file

Found with Wine.

I've attached a C file that's a minimal-ish reproducer.

I don't currently have a machine with gcc 13.1.0, so I did this using
godbolt.org's "MinGW gcc 13.1.0" target, with "-m32". Full compiler flags are
"-m32 -march=znver4 -O2".

The generated output begins

        pushl   %ebp
        vpxor   %xmm0, %xmm0, %xmm0
        movl    %esp, %ebp
        subl    $424, %esp
        vmovdqa %xmm0, 16(%esp)

which is broken. Using -march=znver3 instead will generate the same vmovdqa
instruction, but align the stack first:

        pushl   %ebp
        vpxor   %xmm0, %xmm0, %xmm0
        movl    %esp, %ebp
        andl    $-16, %esp
        subl    $416, %esp
        leal    36(%esp), %eax
        movl    $380, 8(%esp)
        movl    $0, 4(%esp)
        vmovdqa %xmm0, 16(%esp)

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2024-06-20  9:13 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-15 21:53 [Bug target/110273] New: i686-w64-mingw32 with -march=znver4 generates AVX instructions without stack alignment zfigura at codeweavers dot com
2023-06-15 21:54 ` [Bug target/110273] " zfigura at codeweavers dot com
2023-06-15 22:25 ` pinskia at gcc dot gnu.org
2023-06-16  8:00 ` amonakov at gcc dot gnu.org
2023-06-16  8:40 ` amonakov at gcc dot gnu.org
2023-06-16 16:50 ` [Bug target/110273] [12/13/14 Regression] i686-w64-mingw32 with -mavx512f " hjl.tools at gmail dot com
2023-06-16 17:24 ` amonakov at gcc dot gnu.org
2023-06-23  9:42 ` rguenth at gcc dot gnu.org
2023-06-26  8:23 ` sjames at gcc dot gnu.org
2023-06-26  8:26 ` amonakov at gcc dot gnu.org
2023-06-26  8:32 ` sjames at gcc dot gnu.org
2023-12-10 17:58 ` hanno@schwalm-bremen.de
2023-12-10 19:59 ` sjames at gcc dot gnu.org
2023-12-10 20:02 ` pinskia at gcc dot gnu.org
2023-12-10 23:28 ` zfigura at codeweavers dot com
2024-01-27 19:01 ` hjl.tools at gmail dot com
2024-03-22 13:45 ` law at gcc dot gnu.org
2024-06-20  9:13 ` [Bug target/110273] [12/13/14/15 " rguenth at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).