public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/98544] [11 regression] Wrong code generated by tree vectorizer since r11-3917-g28290cb50c7dbf87
Date: Thu, 07 Jan 2021 15:19:55 +0000	[thread overview]
Message-ID: <bug-98544-4-xWqrotC4LP@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-98544-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #11 from Richard Biener <rguenth at gcc dot gnu.org> ---
Or massaging the C++ to produce a single-function testcase (driver still
missing,
I think we can remove the "unrelated" loops as well).  What kind of shape (w/o
too much guessing) is the function expecting for its input arrays?

typedef unsigned long size_t;

template<typename T> inline void PM(T &a, T &b, T c, T d)
  { a=c+d; b=c-d; }
template<typename T1, typename T2, typename T3> inline void MULPM
  (T1 &a, T1 &b, T2 c, T2 d, T3 e, T3 f)
  {  a=c*e+d*f; b=c*f-d*e; }

typedef double T;
void radb2(size_t ido, size_t l1,
           const T * __restrict cc, T * __restrict ch,
           const T * __restrict wa)
{
  auto WA = [wa,ido](size_t x, size_t i) { return wa[i+x*(ido-1)]; };
  auto CC = [cc,ido](size_t a, size_t b, size_t c) -> const T&
    { return cc[a+ido*(b+2*c)]; };
  auto CH = [ch,ido,l1](size_t a, size_t b, size_t c) -> T&
    { return ch[a+ido*(b+l1*c)]; };

  for (size_t k=0; k<l1; k++)
    PM (CH(0,k,0),CH(0,k,1),CC(0,0,k),CC(ido-1,1,k));
  if ((ido&1)==0)
    for (size_t k=0; k<l1; k++)
      {
        CH(ido-1,k,0) = T( 2)*CC(ido-1,0,k);
        CH(ido-1,k,1) = T(-2)*CC(0    ,1,k);
      }
  if (ido<=2) return;
  for (size_t k=0; k<l1;++k)
    for (size_t i=2; i<ido; i+=2)
      {
        size_t ic=ido-i;
        T ti2, tr2;
        PM (CH(i-1,k,0),tr2,CC(i-1,0,k),CC(ic-1,1,k));
        PM (ti2,CH(i  ,k,0),CC(i  ,0,k),CC(ic  ,1,k));
        MULPM (CH(i,k,1),CH(i-1,k,1),WA(0,i-2),WA(0,i-1),ti2,tr2);
      }
}

  parent reply	other threads:[~2021-01-07 15:19 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-05 18:50 [Bug c++/98544] New: [11 regression] Wrong code generated by tree vectorizer martin@mpa-garching.mpg.de
2021-01-05 19:36 ` [Bug tree-optimization/98544] " martin@mpa-garching.mpg.de
2021-01-06  6:00 ` marxin at gcc dot gnu.org
2021-01-06  6:03 ` [Bug tree-optimization/98544] [11 regression] Wrong code generated by tree vectorizer since r11-3917-g28290cb50c7dbf87 marxin at gcc dot gnu.org
2021-01-06  9:02 ` rguenth at gcc dot gnu.org
2021-01-07 13:59 ` rguenth at gcc dot gnu.org
2021-01-07 14:26 ` marxin at gcc dot gnu.org
2021-01-07 14:27 ` rguenth at gcc dot gnu.org
2021-01-07 14:35 ` rguenth at gcc dot gnu.org
2021-01-07 15:01 ` rguenth at gcc dot gnu.org
2021-01-07 15:05 ` rguenth at gcc dot gnu.org
2021-01-07 15:19 ` rguenth at gcc dot gnu.org [this message]
2021-01-07 15:29 ` rguenth at gcc dot gnu.org
2021-01-07 15:37 ` martin@mpa-garching.mpg.de
2021-01-07 15:50 ` rguenth at gcc dot gnu.org
2021-01-07 16:08 ` martin@mpa-garching.mpg.de
2021-01-07 16:48 ` rguenth at gcc dot gnu.org
2021-01-08 12:14 ` rguenth at gcc dot gnu.org
2021-01-08 12:16 ` rguenth at gcc dot gnu.org
2021-01-08 12:20 ` marxin at gcc dot gnu.org
2021-01-08 13:09 ` cvs-commit at gcc dot gnu.org
2021-01-08 13:09 ` rguenth at gcc dot gnu.org
2021-01-08 14:07 ` martin@mpa-garching.mpg.de
2021-01-08 14:18 ` rguenther at suse dot de

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-98544-4-xWqrotC4LP@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).