From 3d57d7cee73c4606a1c2fd7a936285b8496eb41a Mon Sep 17 00:00:00 2001 From: Doug Kwan Date: Tue, 15 Apr 2008 19:56:20 +0000 Subject: [PATCH] dwarf2asm.c (dw2_assemble_integer): Cast to unsigned HOST_WIDE_INT for hex printing. 2008-04-15 Doug Kwan * dwarf2asm.c (dw2_assemble_integer): Cast to unsigned HOST_WIDE_INT for hex printing. * tree-pretty-print.c (dump_generic_node): Ditto. * final.c (output_addr_const): Ditto. * dwarf2out.c (output_cfi): Ditto. * c-pretty-print.c (pp_c_integer_constant): Ditto. * print-rtl.c (print_rtx): Ditto. * print-tree.c (print_node_brief, print_node): Ditto. * c-common.c (match_case_to_enum_1): Ditto. * sched-vis.c (print_value): Ditto. * config/i386/i386.c (print_operand): Cast to long unsigned int for hex printing. From-SVN: r134331 --- gcc/ChangeLog | 15 +++++++++++++++ gcc/c-common.c | 3 ++- gcc/c-pretty-print.c | 4 ++-- gcc/config/i386/i386.c | 2 +- gcc/dwarf2asm.c | 3 ++- gcc/dwarf2out.c | 3 ++- gcc/final.c | 9 ++++++--- gcc/print-rtl.c | 2 +- gcc/print-tree.c | 6 ++++-- gcc/sched-vis.c | 3 ++- gcc/tree-pretty-print.c | 3 ++- 11 files changed, 39 insertions(+), 14 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index eae2c9edf72..0295ec08d5e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,18 @@ +2008-04-15 Doug Kwan + + * dwarf2asm.c (dw2_assemble_integer): Cast to unsigned HOST_WIDE_INT + for hex printing. + * tree-pretty-print.c (dump_generic_node): Ditto. + * final.c (output_addr_const): Ditto. + * dwarf2out.c (output_cfi): Ditto. + * c-pretty-print.c (pp_c_integer_constant): Ditto. + * print-rtl.c (print_rtx): Ditto. + * print-tree.c (print_node_brief, print_node): Ditto. + * c-common.c (match_case_to_enum_1): Ditto. + * sched-vis.c (print_value): Ditto. + * config/i386/i386.c (print_operand): Cast to long unsigned int + for hex printing. + 2008-04-15 Danny Smith * libgcc2.c [L_trampoline]: Remove unnecessary prototype for MS Windows VirtualProtect function. diff --git a/gcc/c-common.c b/gcc/c-common.c index 7e609deeb50..ceb2f0666c3 100644 --- a/gcc/c-common.c +++ b/gcc/c-common.c @@ -4332,7 +4332,8 @@ match_case_to_enum_1 (tree key, tree type, tree label) -TREE_INT_CST_LOW (key)); else snprintf (buf, sizeof (buf), HOST_WIDE_INT_PRINT_DOUBLE_HEX, - TREE_INT_CST_HIGH (key), TREE_INT_CST_LOW (key)); + (unsigned HOST_WIDE_INT) TREE_INT_CST_HIGH (key), + (unsigned HOST_WIDE_INT) TREE_INT_CST_LOW (key)); if (TYPE_NAME (type) == 0) warning (warn_switch ? OPT_Wswitch : OPT_Wswitch_enum, diff --git a/gcc/c-pretty-print.c b/gcc/c-pretty-print.c index 39044a3cebd..3c2f0218461 100644 --- a/gcc/c-pretty-print.c +++ b/gcc/c-pretty-print.c @@ -832,8 +832,8 @@ pp_c_integer_constant (c_pretty_printer *pp, tree i) high = ~high + !low; low = -low; } - sprintf (pp_buffer (pp)->digit_buffer, - HOST_WIDE_INT_PRINT_DOUBLE_HEX, high, low); + sprintf (pp_buffer (pp)->digit_buffer, HOST_WIDE_INT_PRINT_DOUBLE_HEX, + (unsigned HOST_WIDE_INT) high, (unsigned HOST_WIDE_INT) low); pp_string (pp, pp_buffer (pp)->digit_buffer); } if (TYPE_UNSIGNED (type)) diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 6fcbe6637e1..4bb686f818b 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -9288,7 +9288,7 @@ print_operand (FILE *file, rtx x, int code) if (ASSEMBLER_DIALECT == ASM_ATT) putc ('$', file); - fprintf (file, "0x%08lx", l); + fprintf (file, "0x%08lx", (long unsigned int) l); } /* These float cases don't actually occur as immediate operands. */ diff --git a/gcc/dwarf2asm.c b/gcc/dwarf2asm.c index 11903fe81a9..552bf170218 100644 --- a/gcc/dwarf2asm.c +++ b/gcc/dwarf2asm.c @@ -52,7 +52,8 @@ dw2_assemble_integer (int size, rtx x) { fputs (op, asm_out_file); if (GET_CODE (x) == CONST_INT) - fprintf (asm_out_file, HOST_WIDE_INT_PRINT_HEX, INTVAL (x)); + fprintf (asm_out_file, HOST_WIDE_INT_PRINT_HEX, + (unsigned HOST_WIDE_INT) INTVAL (x)); else output_addr_const (asm_out_file, x); } diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 2d8736de0fc..49c13d2afe4 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -2116,7 +2116,8 @@ output_cfi (dw_cfi_ref cfi, dw_fde_ref fde, int for_eh) dw2_asm_output_data (1, (cfi->dw_cfi_opc | (cfi->dw_cfi_oprnd1.dw_cfi_offset & 0x3f)), "DW_CFA_advance_loc " HOST_WIDE_INT_PRINT_HEX, - cfi->dw_cfi_oprnd1.dw_cfi_offset); + ((unsigned HOST_WIDE_INT) + cfi->dw_cfi_oprnd1.dw_cfi_offset)); else if (cfi->dw_cfi_opc == DW_CFA_offset) { r = DWARF2_FRAME_REG_OUT (cfi->dw_cfi_oprnd1.dw_cfi_reg_num, for_eh); diff --git a/gcc/final.c b/gcc/final.c index 98166247925..6d861c76e62 100644 --- a/gcc/final.c +++ b/gcc/final.c @@ -3416,9 +3416,11 @@ output_addr_const (FILE *file, rtx x) /* We can use %d if the number is one word and positive. */ if (CONST_DOUBLE_HIGH (x)) fprintf (file, HOST_WIDE_INT_PRINT_DOUBLE_HEX, - CONST_DOUBLE_HIGH (x), CONST_DOUBLE_LOW (x)); + (unsigned HOST_WIDE_INT) CONST_DOUBLE_HIGH (x), + (unsigned HOST_WIDE_INT) CONST_DOUBLE_LOW (x)); else if (CONST_DOUBLE_LOW (x) < 0) - fprintf (file, HOST_WIDE_INT_PRINT_HEX, CONST_DOUBLE_LOW (x)); + fprintf (file, HOST_WIDE_INT_PRINT_HEX, + (unsigned HOST_WIDE_INT) CONST_DOUBLE_LOW (x)); else fprintf (file, HOST_WIDE_INT_PRINT_DEC, CONST_DOUBLE_LOW (x)); } @@ -3429,7 +3431,8 @@ output_addr_const (FILE *file, rtx x) break; case CONST_FIXED: - fprintf (file, HOST_WIDE_INT_PRINT_HEX, CONST_FIXED_VALUE_LOW (x)); + fprintf (file, HOST_WIDE_INT_PRINT_HEX, + (unsigned HOST_WIDE_INT) CONST_FIXED_VALUE_LOW (x)); break; case PLUS: diff --git a/gcc/print-rtl.c b/gcc/print-rtl.c index d77645573f3..2e96bb4d80a 100644 --- a/gcc/print-rtl.c +++ b/gcc/print-rtl.c @@ -384,7 +384,7 @@ print_rtx (const_rtx in_rtx) fprintf (outfile, HOST_WIDE_INT_PRINT_DEC, XWINT (in_rtx, i)); if (! flag_simple) fprintf (outfile, " [" HOST_WIDE_INT_PRINT_HEX "]", - XWINT (in_rtx, i)); + (unsigned HOST_WIDE_INT) XWINT (in_rtx, i)); break; case 'i': diff --git a/gcc/print-tree.c b/gcc/print-tree.c index f7097a415d4..78fd72ec7c5 100644 --- a/gcc/print-tree.c +++ b/gcc/print-tree.c @@ -127,7 +127,8 @@ print_node_brief (FILE *file, const char *prefix, const_tree node, int indent) -TREE_INT_CST_LOW (node)); else fprintf (file, HOST_WIDE_INT_PRINT_DOUBLE_HEX, - TREE_INT_CST_HIGH (node), TREE_INT_CST_LOW (node)); + (unsigned HOST_WIDE_INT) TREE_INT_CST_HIGH (node), + (unsigned HOST_WIDE_INT) TREE_INT_CST_LOW (node)); } if (TREE_CODE (node) == REAL_CST) { @@ -741,7 +742,8 @@ print_node (FILE *file, const char *prefix, tree node, int indent) -TREE_INT_CST_LOW (node)); else fprintf (file, HOST_WIDE_INT_PRINT_DOUBLE_HEX, - TREE_INT_CST_HIGH (node), TREE_INT_CST_LOW (node)); + (unsigned HOST_WIDE_INT) TREE_INT_CST_HIGH (node), + (unsigned HOST_WIDE_INT) TREE_INT_CST_LOW (node)); break; case REAL_CST: diff --git a/gcc/sched-vis.c b/gcc/sched-vis.c index 8f4597247e5..242791ba9e1 100644 --- a/gcc/sched-vis.c +++ b/gcc/sched-vis.c @@ -434,7 +434,8 @@ print_value (char *buf, const_rtx x, int verbose) switch (GET_CODE (x)) { case CONST_INT: - sprintf (t, HOST_WIDE_INT_PRINT_HEX, INTVAL (x)); + sprintf (t, HOST_WIDE_INT_PRINT_HEX, + (unsigned HOST_WIDE_INT) INTVAL (x)); cur = safe_concat (buf, cur, t); break; case CONST_DOUBLE: diff --git a/gcc/tree-pretty-print.c b/gcc/tree-pretty-print.c index 8b5f847e476..1faeab182dc 100644 --- a/gcc/tree-pretty-print.c +++ b/gcc/tree-pretty-print.c @@ -784,7 +784,8 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags, /* Would "%x%0*x" or "%x%*0x" get zero-padding on all systems? */ sprintf (pp_buffer (buffer)->digit_buffer, - HOST_WIDE_INT_PRINT_DOUBLE_HEX, high, low); + HOST_WIDE_INT_PRINT_DOUBLE_HEX, + (unsigned HOST_WIDE_INT) high, low); pp_string (buffer, pp_buffer (buffer)->digit_buffer); } else -- 2.30.2