ubsan: bpf: left shift cannot be represented in type 'DI' (aka 'long')

cpu/
	* bpf.cpu (f-imm64): Avoid signed overflow.
opcodes/
	* bpf-ibld.c: Regenerate.
This commit is contained in:
Alan Modra 2019-12-17 14:26:39 +10:30
parent 45d735237b
commit 62e6599087
4 changed files with 11 additions and 3 deletions

View File

@ -1,3 +1,7 @@
2019-12-17 Alan Modra <amodra@gmail.com>
* bpf.cpu (f-imm64): Avoid signed overflow.
2019-12-16 Alan Modra <amodra@gmail.com> 2019-12-16 Alan Modra <amodra@gmail.com>
* xstormy16.cpu (f-rel12a): Avoid signed overflow. * xstormy16.cpu (f-rel12a): Avoid signed overflow.

View File

@ -288,8 +288,8 @@
(set (ifield f-imm64-a) (and (ifield f-imm64) (const #xffffffff))))) (set (ifield f-imm64-a) (and (ifield f-imm64) (const #xffffffff)))))
(extract (sequence () (extract (sequence ()
(set (ifield f-imm64) (set (ifield f-imm64)
(or (sll DI (zext DI (ifield f-imm64-c)) (const 32)) (or (sll UDI (zext UDI (ifield f-imm64-c)) (const 32))
(zext DI (ifield f-imm64-a))))))) (zext UDI (ifield f-imm64-a)))))))
;;; Operands ;;; Operands

View File

@ -1,3 +1,7 @@
2019-12-17 Alan Modra <amodra@gmail.com>
* bpf-ibld.c: Regenerate.
2019-12-16 Alan Modra <amodra@gmail.com> 2019-12-16 Alan Modra <amodra@gmail.com>
* aarch64-dis.c (sign_extend): Return uint64_t. Rewrite without * aarch64-dis.c (sign_extend): Return uint64_t. Rewrite without

View File

@ -689,7 +689,7 @@ bpf_cgen_extract_operand (CGEN_CPU_DESC cd,
length = extract_normal (cd, ex_info, insn_value, 0, 96, 31, 32, 32, total_length, pc, & fields->f_imm64_c); length = extract_normal (cd, ex_info, insn_value, 0, 96, 31, 32, 32, total_length, pc, & fields->f_imm64_c);
if (length <= 0) break; if (length <= 0) break;
{ {
FLD (f_imm64) = ((((((DI) (UINT) (FLD (f_imm64_c)))) << (32))) | (((DI) (UINT) (FLD (f_imm64_a))))); FLD (f_imm64) = ((((((UDI) (UINT) (FLD (f_imm64_c)))) << (32))) | (((UDI) (UINT) (FLD (f_imm64_a)))));
} }
} }
break; break;