[Bug tree-optimization/101752] New: vectorizer failed due to comilattion tme alias of same pointer

crazylht at gmail dot com gcc-bugzilla@gcc.gnu.org
Tue Aug 3 12:55:46 GMT 2021


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

            Bug ID: 101752
           Summary: vectorizer failed due to comilattion tme alias of same
                    pointer
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: crazylht at gmail dot com
                CC: rguenth at gcc dot gnu.org
  Target Milestone: ---
              Host: x86_64-pc-linux-gnu

double a[1024], b[1024],c[1024],d[1024],e[1024];
void
foo ()
{
    for (int i = 0; i != 1024; i++)
      if (b[i] < c[i])
        a[i] = __builtin_fma (d[i], e[i], a[i]);
}

gcc -O3 -march=skylake-avx512 -S

/export/users2/liuhongt/tools-build/build_intel-innersource_condop/../../gcc/intel-innersource/condop/gcc/testsuite/gcc.target/i386/cond_op_fma_double-1.c:46:1:
note:   can tell at compile time that a[i_17] and *_33 alias
/export/users2/liuhongt/tools-build/build_intel-innersource_condop/../../gcc/intel-innersource/condop/gcc/testsuite/gcc.target/i386/cond_op_fma_double-1.c:46:1:
missed:   not vectorized: compilation time alias: _3 = a[i_17];
.MASK_STORE (_33, 64B, _32, _7);

a[i_17] is exactly the same as *_33.

# i_17 = PHI <i_13(7), 0(15)>
# ivtmp_16 = PHI <ivtmp_15(7), 800(15)>
_1 = b[i_17];
_2 = c[i_17];
_3 = a[i_17];
_4 = -_3;
_5 = e[i_17];
_6 = d[i_17];
_7 = __builtin_fma (_6, _5, _4);
_32 = _1 < _2;
_33 = &a[i_17];
.MASK_STORE (_33, 64B, _32, _7);
i_13 = i_17 + 1;
ivtmp_15 = ivtmp_16 - 1;
if (ivtmp_15 != 0)
  goto <bb 7>; [98.99%]
else
  goto <bb 6>; [1.01%]


More information about the Gcc-bugs mailing list