aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-family/c-warn.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/c-family/c-warn.cc')
-rw-r--r--gcc/c-family/c-warn.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/gcc/c-family/c-warn.cc b/gcc/c-family/c-warn.cc
index e67dd87..3e2d02a 100644
--- a/gcc/c-family/c-warn.cc
+++ b/gcc/c-family/c-warn.cc
@@ -1517,13 +1517,15 @@ match_case_to_enum_1 (tree key, tree type, tree label)
return;
char buf[WIDE_INT_PRINT_BUFFER_SIZE];
+ wide_int w = wi::to_wide (key);
+ gcc_assert (w.get_precision () <= WIDE_INT_MAX_INL_PRECISION);
if (tree_fits_uhwi_p (key))
- print_dec (wi::to_wide (key), buf, UNSIGNED);
+ print_dec (w, buf, UNSIGNED);
else if (tree_fits_shwi_p (key))
- print_dec (wi::to_wide (key), buf, SIGNED);
+ print_dec (w, buf, SIGNED);
else
- print_hex (wi::to_wide (key), buf);
+ print_hex (w, buf);
if (TYPE_NAME (type) == NULL_TREE)
warning_at (DECL_SOURCE_LOCATION (CASE_LABEL (label)),