public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "hanno@schwalm-bremen.de" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/110273] [12/13/14 Regression] i686-w64-mingw32 with -mavx512f generates AVX instructions without stack alignment
Date: Sun, 10 Dec 2023 17:58:26 +0000	[thread overview]
Message-ID: <bug-110273-4-zsb0R9kRuM@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-110273-4@http.gcc.gnu.org/bugzilla/>

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

Jens-Hanno Schwalm <hanno@schwalm-bremen.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hanno@schwalm-bremen.de

--- Comment #10 from Jens-Hanno Schwalm <hanno@schwalm-bremen.de> ---
Hi, i think we found a very-similar issue in darktable code, you might look at

https://github.com/darktable-org/darktable/pull/15742

In short
- reported with gcc 13.2.1, -march=znver4 or using -fvect-cost-model=dynamic

The code in question was
```
typedef struct dt_draw_curve_t
{
  CurveData c;
  CurveSample csample;
} dt_draw_curve_t;

static inline void dt_draw_curve_set_point(dt_draw_curve_t *c,
                                           const int num,
                                           const float x,
                                           const float y)
{
  c->c.m_anchors[num].x = x;
  c->c.m_anchors[num].y = y;
}


static void _generate_curve_lut( ...)
{
  ...
  dt_iop_rgbcurve_node_t curve_nodes[3][20];
  ...
     for(int k = 0; k < d->params.curve_num_nodes[ch]; k++)
      dt_draw_curve_set_point(d->curve[ch], k,
            curve_nodes[ch][k].x,
            curve_nodes[ch][k].y);
 ...
}
```

The relevant point here was:
even if the curve_nodes are not aligned64 the compiled code looked like

lea (%rcx, %rbx,1), %rdi
vmoaps -0x220(%rbp, %rdi,8), %ymm2
vmoups %ymm2, 0x18(%r15,%rcx,8)

forcing an alignment64 on curve_nodes fixed the problem

reporting this as one of darktable devs - no compiler expert at all - and never
reported here before. Yet this seems a bug and possibly the same are originally
reported here.

  parent reply	other threads:[~2023-12-10 17:58 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-15 21:53 [Bug target/110273] New: i686-w64-mingw32 with -march=znver4 " 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 [this message]
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-zsb0R9kRuM@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).