summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Huderle <huderlem@gmail.com>2018-04-06 08:26:08 -0700
committerGitHub <noreply@github.com>2018-04-06 08:26:08 -0700
commit5e1f24558d4e4fb836439a970887a3738e2e7275 (patch)
tree26e1ac24126bd70f1e8af92178f68b2b5a643c10
parent5203c8c1e08c8bc0f499287e60a4158ace85f0db (diff)
parentf05a8ae218d683b2e555a5b6477a6c9bfc829369 (diff)
Merge pull request #12 from camthesaxman/fhex-asm
avoid assembler warning when using -fhex-asm
-rwxr-xr-xgcc/final.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/gcc/final.c b/gcc/final.c
index 87f9641..2eabdae 100755
--- a/gcc/final.c
+++ b/gcc/final.c
@@ -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. */