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/97236] [10/11 Regression] g:e93428a8b056aed83a7678 triggers vlc miscompile
Date: Tue, 29 Sep 2020 14:14:02 +0000	[thread overview]
Message-ID: <bug-97236-4-okAzihIMaE@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-97236-4@http.gcc.gnu.org/bugzilla/>

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rsandifo at gcc dot gnu.org

--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
So what goes wrong is the single-element interleaving code-gen for the pointer
copy.  We have

t.c:18:21: note:   Detected single element interleaving
picture_7(D)->p[i_18].p_pixels step 16

but for the store:

t.c:18:21: missed:   not consecutive access res_8(D)->p[i_18].p_pixels = _1;
t.c:18:21: note:   using strided accesses

...

t.c:18:21: note:   ==> examining statement: _1 =
picture_7(D)->p[i_18].p_pixels;
t.c:18:21: note:   vect_model_load_cost: aligned.
t.c:18:21: note:   vect_model_load_cost: inside_cost = 24, prologue_cost = 0 .

and in group get-load-store type we handle it as (V1DI)

      if (!STMT_VINFO_STRIDED_P (first_stmt_info)
          && (can_overrun_p || !would_overrun_p)
          && compare_step_with_zero (vinfo, stmt_info) > 0)
        {
          /* First cope with the degenerate case of a single-element
             vector.  */
          if (known_eq (TYPE_VECTOR_SUBPARTS (vectype), 1U))
            *memory_access_type = VMAT_CONTIGUOUS;

looks like this needs to be conditional on gap == 0?  Adding that fixes
the testcase.  This was added by g:6737facbb3c53a1f0158b05e4116c161ed9bc319
Richard?  It looks like the !STMT_VINFO_STRIDED_P check might have supposed
to prevent this?  In vectorizable_load we're also doing

  if (memory_access_type == VMAT_GATHER_SCATTER
      || (!slp && memory_access_type == VMAT_CONTIGUOUS))
    grouped_load = false;

but vect_transform_grouped_load doesn't like this case, possibly because
there's nothing to "permute" (eliding that alone doesn't fix the code-gen
issue).

  parent reply	other threads:[~2020-09-29 14:14 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-29  7:12 [Bug tree-optimization/97236] New: " rguenth at gcc dot gnu.org
2020-09-29  7:13 ` [Bug tree-optimization/97236] " rguenth at gcc dot gnu.org
2020-09-29 13:05 ` marxin at gcc dot gnu.org
2020-09-29 13:05 ` marxin at gcc dot gnu.org
2020-09-29 13:06 ` marxin at gcc dot gnu.org
2020-09-29 13:46 ` rguenth at gcc dot gnu.org
2020-09-29 14:14 ` rguenth at gcc dot gnu.org [this message]
2020-09-30  9:20 ` rguenth at gcc dot gnu.org
2020-10-01 13:58 ` cvs-commit at gcc dot gnu.org
2020-10-01 13:59 ` [Bug tree-optimization/97236] [10 " rguenth at gcc dot gnu.org
2020-10-06 11:42 ` cvs-commit at gcc dot gnu.org
2020-10-06 12:20 ` rguenth at gcc dot gnu.org
2021-02-03  8:25 ` rguenth at gcc dot gnu.org
2021-02-03  8:26 ` [Bug tree-optimization/97236] [8/9 " rguenth at gcc dot gnu.org
2021-02-05 15:43 ` cvs-commit at gcc dot gnu.org
2021-02-05 15:44 ` ktkachov at gcc dot gnu.org
2021-02-05 15:45 ` [Bug tree-optimization/97236] [8 " ktkachov at gcc dot gnu.org
2021-02-08 10:33 ` cvs-commit at gcc dot gnu.org
2021-02-08 10:43 ` rguenth at gcc dot gnu.org
2021-03-04  8:06 ` marxin at gcc dot gnu.org
2021-04-19  6:31 ` rguenth 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-97236-4-okAzihIMaE@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).