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/107095] New: gcc.dg/vect/vect-89.c gets miscompiled by DSE
Date: Fri, 30 Sep 2022 10:42:14 +0000	[thread overview]
Message-ID: <bug-107095-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 107095
           Summary: gcc.dg/vect/vect-89.c gets miscompiled by DSE
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rguenth at gcc dot gnu.org
  Target Milestone: ---

When fully masked the loop with 256bit vectors gets optimized by FRE4 to

  <bb 2> [local count: 63136016]:
  .MASK_STORE (&tmp, 256B, { 0, -1, -1, -1, -1, -1, -1, -1 }, { 5, 5, 5, 5, 5,
5, 5, 5 });
  MEM <vector(8) int> [(int *)&tmp + 32B] = { 5, 5, 5, 5, 5, 5, 5, 5 };
  .MASK_STORE (&MEM <struct tmp_struct> [(void *)&tmp + 64B], 256B, { -1, 0, 0,
0, 0, 0, 0, 0 }, { 5, 5, 5, 5, 5, 5, 5, 5 });

  <bb 4> [local count: 1010605809]:
  # i_18 = PHI <i_8(9), 0(2)>
  # ivtmp_3 = PHI <ivtmp_5(9), 16(2)>
  _1 = tmp.y[i_18];
  if (_1 != 5)
    goto <bb 5>; [0.00%]
  else
    goto <bb 6>; [100.00%]

  <bb 5> [count: 0]:
  abort ();

  <bb 6> [local count: 1010605809]:
  i_8 = i_18 + 1;
  ivtmp_5 = ivtmp_3 - 1;
  if (ivtmp_5 != 0)
    goto <bb 9>; [94.12%]
  else
    goto <bb 7>; [5.88%]

  <bb 9> [local count: 951182190]:
  goto <bb 4>; [100.00%]

  <bb 7> [local count: 63136016]:
  tmp ={v} {CLOBBER(eol)};
  return 0;

but then DSE comes along and removes the first .MASK_STORE:

  Deleted dead call: .MASK_STORE (&tmp, 256B, { 0, -1, -1, -1, -1, -1, -1, -1
}, { 5, 5, 5, 5, 5, 5, 5, 5 });

             reply	other threads:[~2022-09-30 10:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-30 10:42 rguenth at gcc dot gnu.org [this message]
2022-09-30 10:46 ` [Bug tree-optimization/107095] " rguenth at gcc dot gnu.org
2022-09-30 11:43 ` cvs-commit at gcc dot gnu.org
2022-09-30 11:43 ` 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-107095-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).