Re: netronome/nfp/bpf/jit.c cannot be build with -O3

From: Jakub Kicinski
Date: Mon May 06 2019 - 17:36:54 EST


On Mon, 06 May 2019 23:24:39 +0200, Oleksandr Natalenko wrote:
> Hi.
>
> On 06.05.2019 23:00, Jakub Kicinski wrote:
> > Any chance you could try different compiler versions? The code in
> > question does not look too unusual. Could you try if removing
> > FIELD_FIT() on line 326 makes a difference?
>
> If building with gcc from CentOS 7:
>
> gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-36)
>
> the issue is not reproducible.

I just did a make CC=gcc-8 CFLAGS=-O3 with GCC 8.2 here, and doesn't
seem to trigger either.

> Also, commenting out the whole "if" block with FIELD_FIT() prevents the
> issue from occurring too.

Hm, could it be that GCC 8.3 has some constant propagation bug which
breaks BUILD_BUG_ON()? My uneducated guess it tries to pull the mask
validation out of FIELD_FIT() and FIELD_PREP() into one place but in
doing so loses some information.