[Bug tree-optimization/126788] New: __builtin_convertvector upconvert + downconvert doesn't cancel out

"liuhongt at gcc dot gnu.org via Gcc-bugs" <[email protected]>
Newsgroups gmane.comp.gcc.bugs
Message-ID <[email protected]/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126788

            Bug ID: 126788
           Summary: __builtin_convertvector upconvert + downconvert
                    doesn't cancel out
           Product: gcc
           Version: 17.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: liuhongt at gcc dot gnu.org
  Target Milestone: ---

This is from pr126784, below is the tectase:

typedef int  v2si __attribute__((vector_size (8)));
typedef long long v2di __attribute__((vector_size (16)));
v2si
f2 (v2si a, v2si b)
{

  v2di z = __builtin_convertvector (a, v2di);
  return __builtin_convertvector (z, v2si);
}


v2si f2 (v2si a, v2si b)
{
  v2di z;
  v2si _3;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  z_2 = (v2di) a_1(D);
  # DEBUG z => z_2
  # DEBUG BEGIN_STMT
  _3 = (v2si) z_2;
  return _3;

}


a_1 can be returned directly.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.