public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "tnfchris at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/113552] [11/12/13/14 Regression] vectorizer generates calls to vector math routines with 1 simd lane.
Date: Tue, 23 Jan 2024 10:12:27 +0000	[thread overview]
Message-ID: <bug-113552-4-2MPOczQl2p@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-113552-4@http.gcc.gnu.org/bugzilla/>

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

Tamar Christina <tnfchris at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |NEW

--- Comment #5 from Tamar Christina <tnfchris at gcc dot gnu.org> ---
__attribute__ ((__simd__ ("notinbranch"), const))
double cos (double);

void foo (float *a, double *b)
{
    for (int i = 0; i < 12; i+=3)
      {
        b[i] = cos (5.0 * a[i]);
        b[i+1] = cos (5.0 * a[i+1]);
        b[i+2] = cos (5.0 * a[i+2]);
      }
}

Simple C example that shows the problem.

This seems to happen when SLP succeeds and the group size is a non power of
two.
The vectorizer then unrolls to make it a power of two and during vectorization
it seems to destroy the vector, make the call and reconstruct it.

So this seems like an SLP vectorization bug.  I can't seem to trigger it
however on GCC < 14 since SLP consistently fails for all my examples because it
tries a mode that's larger than the vector size.

So It may be a GCC 14 only regression, but I think it's latent in the
vectorizer.

  parent reply	other threads:[~2024-01-23 10:12 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-23  7:53 [Bug middle-end/113552] New: " tnfchris at gcc dot gnu.org
2024-01-23  7:53 ` [Bug tree-optimization/113552] " tnfchris at gcc dot gnu.org
2024-01-23  8:13 ` rguenth at gcc dot gnu.org
2024-01-23  8:51 ` nsz at gcc dot gnu.org
2024-01-23  8:51 ` tnfchris at gcc dot gnu.org
2024-01-23  8:54 ` tnfchris at gcc dot gnu.org
2024-01-23 10:12 ` tnfchris at gcc dot gnu.org [this message]
2024-01-23 10:39 ` rguenth at gcc dot gnu.org
2024-01-23 10:56 ` rguenth at gcc dot gnu.org
2024-01-23 10:59 ` rguenth at gcc dot gnu.org
2024-01-23 11:19 ` tnfchris at gcc dot gnu.org
2024-01-23 11:57 ` rguenth at gcc dot gnu.org
2024-01-23 13:10 ` cvs-commit at gcc dot gnu.org
2024-01-24 15:58 ` cvs-commit at gcc dot gnu.org
2024-04-15 11:14 ` [Bug tree-optimization/113552] [11/12/13 " cvs-commit at gcc dot gnu.org
2024-04-15 11:38 ` cvs-commit at gcc dot gnu.org
2024-04-15 11:40 ` tnfchris 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-113552-4-2MPOczQl2p@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).