ubsan: bpf: left shift cannot be represented in type 'DI' (aka 'long')
[deliverable/binutils-gdb.git] / opcodes / tilepro-opc.c
index ea158222eada7b34ce9bab03f721dd169a145dc4..c71da3df8a11c04796cbbe0d45426614884cf0e6 100644 (file)
@@ -10220,8 +10220,8 @@ parse_insn_tilepro (tilepro_bundle_bits bits,
          if (op->is_signed)
            {
              /* Sign-extend the operand.  */
-             int shift = (int)((sizeof(int) * 8) - op->num_bits);
-             opval = (opval << shift) >> shift;
+             unsigned int sign = 1u << (op->num_bits - 1);
+             opval = ((opval & (sign + sign - 1)) ^ sign) - sign;
            }
 
          /* Adjust PC-relative scaled branch offsets.  */
This page took 0.024837 seconds and 4 git commands to generate.