Re: [pcre-dev] Compiler warnings in JIT with NEON instructio…

Pàgina inicial
Delete this message
Autor: Petr Pisar
Data:  
A: Pcre-dev
Assumpte: Re: [pcre-dev] Compiler warnings in JIT with NEON instructions
On Sun, Nov 10, 2019 at 01:09:06PM -0600, Sebastian Pop wrote:
> Hi Zoltán and Petr,
>
> Please find attached a patch that fixes all the test fails for
> PCRE2_CODE_UNIT_WIDTH 16 and 32.
>
> In my previous patch for some reason I have not tested `make check`
> with --enable-pcre2-16 --enable-pcre2-32.
> This time I made sure I have a clean dir configured with these two
> flags and `make check` now passes with the attached patch.
> Thanks Petr for pointing out the issues, and sorry for the confusion.
>

I confirm that the patch fixes most of the warnings and that tests pass for me
now.

These warnings remain:

src/pcre2_jit_neon_inc.h: In function 'ffcs':
src/pcre2_jit_neon_inc.h:169:1: warning: label 'restart' defined but not used [-Wunused-label]
  169 | restart:;
      | ^~~~~~~
In file included from src/pcre2_jit_simd_inc.h:711,
                 from src/pcre2_jit_compile.c:5522:
src/pcre2_jit_neon_inc.h: In function 'ffcs_2':
src/pcre2_jit_neon_inc.h:169:1: warning: label 'restart' defined but not used [-Wunused-label]
  169 | restart:;
      | ^~~~~~~
In file included from src/pcre2_jit_simd_inc.h:720,
                 from src/pcre2_jit_compile.c:5522:
src/pcre2_jit_neon_inc.h: In function 'ffcs_mask':
src/pcre2_jit_neon_inc.h:169:1: warning: label 'restart' defined but not used [-Wunused-label]
  169 | restart:;
      | ^~~~~~~
In file included from src/pcre2_jit_simd_inc.h:878,
                 from src/pcre2_jit_compile.c:5522:
src/pcre2_jit_neon_inc.h: In function 'ffcps_0':
src/pcre2_jit_neon_inc.h:169:1: warning: label 'restart' defined but not used [-Wunused-label]
  169 | restart:;
      | ^~~~~~~
In file included from src/pcre2_jit_simd_inc.h:889,
                 from src/pcre2_jit_compile.c:5522:
src/pcre2_jit_neon_inc.h: In function 'ffcps_1':
src/pcre2_jit_neon_inc.h:169:1: warning: label 'restart' defined but not used [-Wunused-label]
  169 | restart:;
      | ^~~~~~~
In file included from src/pcre2_jit_simd_inc.h:900,
                 from src/pcre2_jit_compile.c:5522:
src/pcre2_jit_neon_inc.h: In function 'ffcps_default':
src/pcre2_jit_neon_inc.h:169:1: warning: label 'restart' defined but not used [-Wunused-label]
  169 | restart:;
      | ^~~~~~~


The restart label is used only once:

#if defined(FF_UTF)
  if (utf_continue(str_ptr + IN_UCHARS(-offs1)))
    {
    /* Not a match. */
    str_ptr += IN_UCHARS(1);
    goto restart;
    }
#endif


Maybe the label definition should be guarded with #if defined(FF_UTF).


And this warning is more worrysome:

In file included from src/pcre2_jit_compile.c:5522:
src/pcre2_jit_simd_inc.h: In function 'shift_left_n_lanes':
src/pcre2_jit_simd_inc.h:871:1: warning: control reaches end of non-void function [-Wreturn-type]
  871 | }
      | ^


Shouldn't the vect_t shift_left_n_lanes(vect_t a, sljit_u8 n) function return a?

-- Petr