avoid assembler warning when using -fhex-asm

This commit is contained in:
camthesaxman
2017-10-26 14:59:00 -05:00
parent 928b195197
commit f05a8ae218

View File

@@ -341,7 +341,17 @@ static struct label_alignment *label_align;
static void
print_wint(FILE *file, HOST_WIDE_INT value)
{
fprintf(file, flag_hex_asm ? HOST_WIDE_INT_PRINT_HEX : HOST_WIDE_INT_PRINT_DEC, value);
const char *fmt = HOST_WIDE_INT_PRINT_DEC;
if (flag_hex_asm)
{
fmt = HOST_WIDE_INT_PRINT_HEX;
if (value < 0)
{
fputc('-', file);
value = -value;
}
}
fprintf(file, fmt, value);
}
/* Indicate that branch shortening hasn't yet been done. */