From b8e61daa1ad56330fd8931c8a53bfa16d8e4a47a Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Tue, 10 Dec 2019 18:06:09 +1030 Subject: ubsan: epiphany: left shift of negative value Two places in epiphany_cgen_extract_operand, "value" is a long. value = ((((value) << (1))) + (pc)); cpu/ * epiphany.cpu (f-simm8, f-simm24): Use multiply rather than shift left to avoid UB on left shift of negative values. opcodes/ * epiphany-ibld.c: Regenerate. --- opcodes/epiphany-ibld.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'opcodes/epiphany-ibld.c') diff --git a/opcodes/epiphany-ibld.c b/opcodes/epiphany-ibld.c index 83cfaf3..6e6fd7b 100644 --- a/opcodes/epiphany-ibld.c +++ b/opcodes/epiphany-ibld.c @@ -1100,7 +1100,7 @@ epiphany_cgen_extract_operand (CGEN_CPU_DESC cd, { long value; length = extract_normal (cd, ex_info, insn_value, 0|(1<f_simm24 = value; } break; @@ -1111,7 +1111,7 @@ epiphany_cgen_extract_operand (CGEN_CPU_DESC cd, { long value; length = extract_normal (cd, ex_info, insn_value, 0|(1<f_simm8 = value; } break; -- cgit v1.1