diff options
Diffstat (limited to 'gcc/c-family/c-common.c')
-rw-r--r-- | gcc/c-family/c-common.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c index b4ee2ed..9754a66 100644 --- a/gcc/c-family/c-common.c +++ b/gcc/c-family/c-common.c @@ -2242,15 +2242,15 @@ c_common_type_for_mode (machine_mode mode, int unsignedp) if (mode == TYPE_MODE (void_type_node)) return void_type_node; - if (mode == TYPE_MODE (build_pointer_type (char_type_node))) - return (unsignedp - ? make_unsigned_type (GET_MODE_PRECISION (mode)) - : make_signed_type (GET_MODE_PRECISION (mode))); - - if (mode == TYPE_MODE (build_pointer_type (integer_type_node))) - return (unsignedp - ? make_unsigned_type (GET_MODE_PRECISION (mode)) - : make_signed_type (GET_MODE_PRECISION (mode))); + if (mode == TYPE_MODE (build_pointer_type (char_type_node)) + || mode == TYPE_MODE (build_pointer_type (integer_type_node))) + { + unsigned int precision + = GET_MODE_PRECISION (as_a <scalar_int_mode> (mode)); + return (unsignedp + ? make_unsigned_type (precision) + : make_signed_type (precision)); + } if (COMPLEX_MODE_P (mode)) { |