From 5af50159079d2f37118e4eaa6dd269be5d6e1506 Mon Sep 17 00:00:00 2001 From: Kito Cheng Date: Sat, 17 Mar 2018 12:11:22 +0000 Subject: [NDS32] Use HOST_WIDE_INT_PRINT_DEC instead of %ld or %d. gcc/ * config/nds32/nds32.c (nds32_asm_output_mi_thunk, nds32_print_operand, nds32_print_operand_address): Use HOST_WIDE_INT_PRINT_DEC instead. From-SVN: r258620 --- gcc/config/nds32/nds32.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'gcc/config') diff --git a/gcc/config/nds32/nds32.c b/gcc/config/nds32/nds32.c index 02b1eb4..e0836d8 100644 --- a/gcc/config/nds32/nds32.c +++ b/gcc/config/nds32/nds32.c @@ -1689,18 +1689,22 @@ nds32_asm_output_mi_thunk (FILE *file, tree thunk ATTRIBUTE_UNUSED, { if (satisfies_constraint_Is15 (GEN_INT (delta))) { - fprintf (file, "\taddi\t$r%d, $r%d, %ld\n", + fprintf (file, "\taddi\t$r%d, $r%d, " HOST_WIDE_INT_PRINT_DEC "\n", this_regno, this_regno, delta); } else if (satisfies_constraint_Is20 (GEN_INT (delta))) { - fprintf (file, "\tmovi\t$ta, %ld\n", delta); + fprintf (file, "\tmovi\t$ta, " HOST_WIDE_INT_PRINT_DEC "\n", delta); fprintf (file, "\tadd\t$r%d, $r%d, $ta\n", this_regno, this_regno); } else { - fprintf (file, "\tsethi\t$ta, hi20(%ld)\n", delta); - fprintf (file, "\tori\t$ta, $ta, lo12(%ld)\n", delta); + fprintf (file, + "\tsethi\t$ta, hi20(" HOST_WIDE_INT_PRINT_DEC ")\n", + delta); + fprintf (file, + "\tori\t$ta, $ta, lo12(" HOST_WIDE_INT_PRINT_DEC ")\n", + delta); fprintf (file, "\tadd\t$r%d, $r%d, $ta\n", this_regno, this_regno); } } @@ -2318,7 +2322,7 @@ nds32_print_operand (FILE *stream, rtx x, int code) { /* If user gives integer value directly (0~1023), we just print out the value. */ - fprintf (stream, "%d", op_value); + fprintf (stream, HOST_WIDE_INT_PRINT_DEC, op_value); } else if (op_value < 0 || op_value >= ((int) ARRAY_SIZE (nds32_intrinsic_register_names) @@ -2429,8 +2433,8 @@ nds32_print_operand_address (FILE *stream, machine_mode /*mode*/, rtx x) if (REG_P (op0) && CONST_INT_P (op1)) { /* [Ra + imm] */ - fprintf (stream, "[%s + (%d)]", - reg_names[REGNO (op0)], (int)INTVAL (op1)); + fprintf (stream, "[%s + (" HOST_WIDE_INT_PRINT_DEC ")]", + reg_names[REGNO (op0)], INTVAL (op1)); } else if (REG_P (op0) && REG_P (op1)) { @@ -2501,8 +2505,8 @@ nds32_print_operand_address (FILE *stream, machine_mode /*mode*/, rtx x) else if (REG_P (op0) && CONST_INT_P (op1)) { /* [Ra], imm */ - fprintf (stream, "[%s], %d", - reg_names[REGNO (op0)], (int)INTVAL (op1)); + fprintf (stream, "[%s], " HOST_WIDE_INT_PRINT_DEC, + reg_names[REGNO (op0)], INTVAL (op1)); } else { -- cgit v1.1