Skip to content

Commit

Permalink
BUG, SIMD: Fix infinite loop during count non-zero on GCC-11
Browse files Browse the repository at this point in the history
  The issue appears when the compiler miss inlining a function that
  returns or accepts a SIMD vector.
  • Loading branch information
seiko2plus authored and charris committed Jul 16, 2021
1 parent c084058 commit 16ba6ba
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions numpy/core/src/multiarray/item_selection.c
Original file line number Diff line number Diff line change
Expand Up @@ -2131,7 +2131,7 @@ count_nonzero_bytes_384(const npy_uint64 * w)

#if NPY_SIMD
/* Count the zero bytes between `*d` and `end`, updating `*d` to point to where to keep counting from. */
static NPY_INLINE NPY_GCC_OPT_3 npyv_u8
NPY_FINLINE NPY_GCC_OPT_3 npyv_u8
count_zero_bytes_u8(const npy_uint8 **d, const npy_uint8 *end, npy_uint8 max_count)
{
const npyv_u8 vone = npyv_setall_u8(1);
Expand All @@ -2150,7 +2150,7 @@ count_zero_bytes_u8(const npy_uint8 **d, const npy_uint8 *end, npy_uint8 max_cou
return vsum8;
}

static NPY_INLINE NPY_GCC_OPT_3 npyv_u16x2
NPY_FINLINE NPY_GCC_OPT_3 npyv_u16x2
count_zero_bytes_u16(const npy_uint8 **d, const npy_uint8 *end, npy_uint16 max_count)
{
npyv_u16x2 vsum16;
Expand Down

0 comments on commit 16ba6ba

Please sign in to comment.