public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "zfigura at codeweavers dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/110273] New: i686-w64-mingw32 with -march=znver4 generates AVX instructions without stack alignment
Date: Thu, 15 Jun 2023 21:53:19 +0000	[thread overview]
Message-ID: <bug-110273-4@http.gcc.gnu.org/bugzilla/> (raw)

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)

             reply	other threads:[~2023-06-15 21:53 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-15 21:53 zfigura at codeweavers dot com [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-110273-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).