-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
Medium
-
Code Generation Tools
-
CODEGEN-10754
-
-
ARM_20.2.7.LTS
-
ARM_20.2.8.LTS*
-
default
The attachment [^file.c]has this function ...
_Bool pb_encode_varint(pb_ostream_t *stream, uint64_t value)
{
if (value <= 0x7F)
{
/* Fast path: single byte */
pb_byte_t byte = (pb_byte_t)value;
return pb_write(stream, &byte, 1);
}
else
{
return pb_encode_varint_32(stream, (uint32_t)value, (uint32_t)(value >> 32));
}
}
Build it ...
armcl -@options.txt file.c
Inspect the resulting assembly file to see these lines near the start of the function ...
MOV V9, A1 ; [DPU_V7M3_PIPE] |97591|
.dwpsn file "file.c",line 97592,column 5,is_stmt,isa 1
MOVS V4, A4 ; [DPU_V7M3_PIPE] |97592|
IT EQ ; [DPU_V7M3_PIPE]
CMPEQ A3, #127 ; [DPU_V7M3_PIPE] |97592|
BHI ||$C$L43|| ; [DPU_V7M3_PIPE] |97592|
For the case seen by the customer, the call is ...
pb_ostream_t stream = {0,0,0,0,0};
uint64_t value = 0x200b162d74e5;
if(pb_encode_varint(&stream, value))
The value argument is much greater then 0x7f. So the BHI conditional branch should be taken. But it isn't.
When built with --opt_level=2 or lower, the correct code is generated.