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

--- Comment #2 from Andrew Stubbs <ams at gcc dot gnu.org> ---
This is actually a bug in Newlib libm that is exposed because the testcase is
now vectorizing, where previously the i386 setting of
param_vect_partial_vector_usage was blocking it.

>From newlib/libm/machine/amdgcn/v64sf_fmod.c:

  VECTOR_IF (hy < 0x00800000, cond)    // subnormal y                 
    iy = VECTOR_INIT (-126);                                           
    for (v64si i = (hy << 8); !ALL_ZEROES_P (cond & (i >= 0)); i <<= 1)
      VECTOR_COND_MOVE (iy, iy - 1, cond & (i >= 0));                  

Here the bug is that "i <<= 1" continues to run until the last lane is
finished, which results in some lanes getting shifted too far, which causes
those lanes to become zero, resulting in an infinite loop.

Reply via email to