summaryrefslogtreecommitdiff
path: root/gcc/c-family/c-pretty-print.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/c-family/c-pretty-print.c')
-rw-r--r--gcc/c-family/c-pretty-print.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/gcc/c-family/c-pretty-print.c b/gcc/c-family/c-pretty-print.c
index 62a00306fba..2e97d0147c5 100644
--- a/gcc/c-family/c-pretty-print.c
+++ b/gcc/c-family/c-pretty-print.c
@@ -30,6 +30,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree-pretty-print.h"
#include "tree-iterator.h"
#include "diagnostic.h"
+#include "wide-int-print.h"
/* The pretty-printer code is primarily designed to closely follow
(GNU) C and C++ grammars. That is to be contrasted with spaghetti
@@ -923,16 +924,14 @@ pp_c_integer_constant (c_pretty_printer *pp, tree i)
pp_unsigned_wide_integer (pp, tree_to_uhwi (i));
else
{
- unsigned HOST_WIDE_INT low = TREE_INT_CST_LOW (i);
- HOST_WIDE_INT high = TREE_INT_CST_HIGH (i);
- if (tree_int_cst_sgn (i) < 0)
+ wide_int wi = i;
+
+ if (wi::lt_p (i, 0, TYPE_SIGN (TREE_TYPE (i))))
{
pp_minus (pp);
- high = ~high + !low;
- low = -low;
+ wi = -wi;
}
- sprintf (pp_buffer (pp)->digit_buffer, HOST_WIDE_INT_PRINT_DOUBLE_HEX,
- (unsigned HOST_WIDE_INT) high, (unsigned HOST_WIDE_INT) low);
+ print_hex (wi, pp_buffer (pp)->digit_buffer);
pp_string (pp, pp_buffer (pp)->digit_buffer);
}
if (TYPE_UNSIGNED (type))