public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/110541] New: Invalid VEC_PERM_EXPR mask element size
@ 2023-07-04 11:33 kristerw at gcc dot gnu.org
  2023-07-05  6:55 ` [Bug tree-optimization/110541] " rguenth at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: kristerw at gcc dot gnu.org @ 2023-07-04 11:33 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 110541
           Summary: Invalid VEC_PERM_EXPR mask element size
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: kristerw at gcc dot gnu.org
  Target Milestone: ---

tree.def says:
  The number of MASK elements must be the same with the
  number of elements in V0 and V1.  The size of the inner type
  of the MASK and of the V0 and V1 must be the same.

But tree-vectorizer creates permutations where the MASK element size is
different than for V0 and V1, such as

   vector(8) unsigned short _79;
   ...
  _79 = VEC_PERM_EXPR <_78, { 0, 0, 0, 0, 0, 0, 0, 0 }, { 4, 5, 6, 7, 8, 9, 10,
11 }>;

where the MASK elements are of a 64-bit type.

This can be seen when compiling the following function (from
gcc.c-torture/compile/20000717-1.c) as "gcc -S -O3" for x86_64:

short
inner_product (short *a, short *b)
{
  int i;
  short sum = 0;

  for (i = 9; i >= 0; i--)
    sum += (*a++) * (*b++);

  return sum;
}

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-07-05  8:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-04 11:33 [Bug tree-optimization/110541] New: Invalid VEC_PERM_EXPR mask element size kristerw at gcc dot gnu.org
2023-07-05  6:55 ` [Bug tree-optimization/110541] " rguenth at gcc dot gnu.org
2023-07-05  7:47 ` cvs-commit at gcc dot gnu.org
2023-07-05  8:11 ` rguenth at gcc dot gnu.org

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).