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

            Bug ID: 92710
           Summary: [9/10 Regression] Vectoriser generates invalid simd
                    call for bool arguments
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rsandifo at gcc dot gnu.org
  Target Milestone: ---
            Target: aarch64*-*-*

#pragma omp declare simd
bool foo (bool) __attribute__((const));

void
f (bool *__restrict x, char *__restrict y, char *__restrict z)
{
  for (int i = 0; i < 128; ++i)
    x[i] = foo (y[i] == z[i]);
}

compiled with g++ -O3 -fopenmp-simd ICEs with:

foo.c: In function ‘void f(bool*, char*, char*)’:
foo.c:5:1: error: invalid conversion in gimple call
    5 | f (bool *__restrict x, char *__restrict y, char *__restrict z)
      | ^
vector(16) unsigned char

vector(16) bool

vect__14.10_9 = _Z3foob.simdclone.2 (mask__6.9_17);
during GIMPLE pass: vect
foo.c:5:1: internal compiler error: verify_gimple failed
0x150013e verify_gimple_in_cfg(function*, bool)
        .../tree-cfg.c:5386
0x12b3cf7 execute_function_todo
        .../passes.c:1997
0x12b2c75 do_per_function
        .../passes.c:1638
0x12b3ee7 execute_todo
        .../passes.c:2051
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

This is because we use a vector mask type for the result of the
comparison, but the function expects a normal nonmask vector instead.

The bug doesn't trigger on x86_64 because there the bool argument
is promoted to int.

Reply via email to