lkml.org 
[lkml]   [2019]   [May]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [oss-drivers] netronome/nfp/bpf/jit.c cannot be build with -O3
Date

Oleksandr Natalenko writes:

> Hi.
>
> On 07.05.2019 00:01, Jiong Wang wrote:
>> I guess it's because constant prop. Could you try the following change
>> to
>> __emit_shift?
>>
>> drivers/net/ethernet/netronome/nfp/bpf/jit.c
>> __emit_shift:331
>> - if (sc == SHF_SC_L_SHF)
>> + if (sc == SHF_SC_L_SHF && shift)
>> shift = 32 - shift;
>>
>> emit_shf_indir is passing "0" as shift to __emit_shift which will
>> eventually be turned into 32 and it was OK because we truncate to
>> 5-bit,
>> but before truncation, it will overflow the shift mask.
>
> Yup, it silences the error for me.

Thanks for the testing.

I have also reproduced this issue after switching to gcc 8.3, and confirmed
the error is triggered from "value too large for the field" check inside
__BF_FIELD_CHECK due to immediate "32" is out of range for mask 0x1f.

Will send out a fix.

Regards,
Jiong

\
 
 \ /
  Last update: 2019-05-07 13:32    [W:0.041 / U:0.220 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site