dwarf2asm.c (dw2_assemble_integer): Cast to unsigned HOST_WIDE_INT for hex printing.
authorDoug Kwan <dougkwan@google.com>
Tue, 15 Apr 2008 19:56:20 +0000 (19:56 +0000)
committerDoug Kwan <dougkwan@gcc.gnu.org>
Tue, 15 Apr 2008 19:56:20 +0000 (19:56 +0000)
2008-04-15  Doug Kwan  <dougkwan@google.com>

* 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
gcc/c-common.c
gcc/c-pretty-print.c
gcc/config/i386/i386.c
gcc/dwarf2asm.c
gcc/dwarf2out.c
gcc/final.c
gcc/print-rtl.c
gcc/print-tree.c
gcc/sched-vis.c
gcc/tree-pretty-print.c

index eae2c9e..0295ec0 100644 (file)
@@ -1,3 +1,18 @@
+2008-04-15  Doug Kwan  <dougkwan@google.com>
+
+       * 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  <dannysmith@users.sourceforge.net>
        * libgcc2.c [L_trampoline]: Remove  unnecessary prototype for
        MS Windows VirtualProtect function.
index 7e609de..ceb2f06 100644 (file)
@@ -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,
index 39044a3..3c2f021 100644 (file)
@@ -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))
index 6fcbe66..4bb686f 100644 (file)
@@ -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.  */
index 11903fe..552bf17 100644 (file)
@@ -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);
     }
index 2d8736d..49c13d2 100644 (file)
@@ -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);
index 9816624..6d861c7 100644 (file)
@@ -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:
index d776455..2e96bb4 100644 (file)
@@ -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':
index f7097a4..78fd72e 100644 (file)
@@ -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:
index 8f45972..242791b 100644 (file)
@@ -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:
index 8b5f847..1faeab1 100644 (file)
@@ -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