From patchwork Thu Jul 13 08:50:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 107620 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp1933676qge; Thu, 13 Jul 2017 01:51:50 -0700 (PDT) X-Received: by 10.98.215.73 with SMTP id v9mr60369900pfl.103.1499935910144; Thu, 13 Jul 2017 01:51:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1499935910; cv=none; d=google.com; s=arc-20160816; b=NzhSYFKJawqS0doUWwe3Rb8xJwvJbgXEjP1BM44/F9/dgZyxhnVESMJcZHp7NrPQvS Qt0vmY/QKLGUwbfyQg0VLuiJpBBZfjw2xMAnuGfO+JrmaT/GQx+BNoNQfow5sPELJmmz RhzzO1X6AIEhKjbU4ustDA/B25fj0abKzKAz/5PqdZYc6ofIq52LX/uegRRDIjGOAfmH oUYECmbT4zxun5o1XghBkVlenTV3cj2AlH8Pyd3Q5xRACI91P+8MgdCO1fE37BsiJ/wC Q4l7oxYis2xKYF0BTELR/zX8fQcMINe/Cw5cm7hY1jkJq3BKXHpu/uieXYYGjfpHYhag Tjvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:mail-followup-to:to:from:delivered-to:sender:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :mailing-list:dkim-signature:domainkey-signature :arc-authentication-results; bh=CUFCov01bZ/ZLxin59yqlLL8pE0wBMBFknaGyV6GzOg=; b=LKwv09CE/46f8tmY4ts3wxcUba112ELo521ZEibHBFfFzpONghQJYIm+uR8wr6VYpG 7khE/R/oeacFcLVDENC7acUF1uYqpKecqH0Tgq9aowVX+XUvBchXlT0ZQgXu2S4Fd9Ae /cofc8iWqeyx1GDraYKBn9Fp4S3Ke+SNN5epATZsw58J8nPa77F8msq7uAOQNqL6hmXP ZtjxKZ+RBlvyV/j+/ODJRUVqeB0zI8YJux2lfusTD+b2hFydJDL0d+EWXfmMSKhDPbqT XIx+DYGAkNjhjpW6dZhRbieJoullBcQLhiYBGXrTB+VE149TgHCxhf15EUK2HUYzHfuf Vg/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.b=EcWOFmaF; spf=pass (google.com: domain of gcc-patches-return-458025-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-458025-patch=linaro.org@gcc.gnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id r5si3954863pgj.289.2017.07.13.01.51.49 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 13 Jul 2017 01:51:50 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-458025-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.b=EcWOFmaF; spf=pass (google.com: domain of gcc-patches-return-458025-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-458025-patch=linaro.org@gcc.gnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=default; b=jD9X+2HRvX6X7SBDGrqFpm6J/nOey yNQZJI0KzixuU5o5WF6PVzaj0Wk0J8Y0tjkcjTyasKPYfN1k2mirQi/awNKdsWjw D0a03zkb2Ega9UKkMNqxaAZTNWijKmIR54cqh/4pfnZJCSuCA9Qr2mDUvZJlt5X+ wHwP1lThkPUMuc= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:references:date:in-reply-to:message-id:mime-version :content-type; s=default; bh=/psnYIT0CdjOZKzlXvFcQQ/eKH8=; b=EcW OFmaFfeeeicfJBIfosD3ubr0i7Wo29OPsTJWbd5oYODr5nTLblhsGzwNFoQyofCf 0hVyN/lNldzQwlLa0K/3sEDQS9cu+EJo5/3Y3xkud/n3BBf+bm0kKGdpGL6vK58e htXWtAkgPfBvQMjW+swvtmVz1KnLSHmEmAYdIgdE= Received: (qmail 120925 invoked by alias); 13 Jul 2017 08:51:00 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 120282 invoked by uid 89); 13 Jul 2017 08:50:59 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-15.6 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=ri X-HELO: mail-wm0-f42.google.com Received: from mail-wm0-f42.google.com (HELO mail-wm0-f42.google.com) (74.125.82.42) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 13 Jul 2017 08:50:51 +0000 Received: by mail-wm0-f42.google.com with SMTP id i127so18234383wma.0 for ; Thu, 13 Jul 2017 01:50:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:mail-followup-to:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=CUFCov01bZ/ZLxin59yqlLL8pE0wBMBFknaGyV6GzOg=; b=ehuVTN3wQPTCZl1vML3Ou4ej855skn50kYVziOEsSPdAxzHzgJppaswMlx53uZ1zdP bmeGyePaKKAS5VfgEekN7M71pG0cbOKgueNwL7wl98bSWzlpSq6eht2sJlWrwmzUwJ10 wOKoc+XOzUXWmpbu2EajiZEc8KjBf5fhaf/jyzEnyiC/9S7WNWuYhtDtwb9dNqu5/XrW 5gYejxQozPNcIfxSP6FBNQgXbyhcA8L8C/I5cHnM/WoyA6fKpXo6esmFQFaVegRpccHg QilCQ5ols4GsGtqgIgQlbTmAJ0//eKmUgIV2B/dx3egqFJ3GxYmUJQU9UZzofg9PvWJL BOrQ== X-Gm-Message-State: AIVw113imRb/z0CGLotdeebInLjIOomBwykAGlz5roZolYt3MORvkyVj 9VNv7k/pJG1fSFc6VYdOxA== X-Received: by 10.28.137.199 with SMTP id l190mr1121522wmd.117.1499935848419; Thu, 13 Jul 2017 01:50:48 -0700 (PDT) Received: from localhost (92.40.249.184.threembb.co.uk. [92.40.249.184]) by smtp.gmail.com with ESMTPSA id p27sm5857728wmf.23.2017.07.13.01.50.47 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 13 Jul 2017 01:50:47 -0700 (PDT) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, richard.sandiford@linaro.org Subject: [34/77] Add a SCALAR_INT_TYPE_MODE macro References: <8760ewohsv.fsf@linaro.org> Date: Thu, 13 Jul 2017 09:50:45 +0100 In-Reply-To: <8760ewohsv.fsf@linaro.org> (Richard Sandiford's message of "Thu, 13 Jul 2017 09:35:44 +0100") Message-ID: <8737a0iuu2.fsf@linaro.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 This patch adds a SCALAR_INT_TYPE_MODE macro that asserts that the type has a scalar integer mode and returns it as a scalar_int_mode. 2017-07-13 Richard Sandiford Alan Hayward David Sherwood gcc/ * tree.h (SCALAR_INT_TYPE_MODE): New macro. * builtins.c (expand_builtin_signbit): Use it. * cfgexpand.c (expand_debug_expr): Likewise. * dojump.c (do_jump): Likewise. (do_compare_and_jump): Likewise. * dwarf2cfi.c (expand_builtin_init_dwarf_reg_sizes): Likewise. * expmed.c (make_tree): Likewise. * expr.c (expand_expr_real_2): Likewise. (expand_expr_real_1): Likewise. (try_casesi): Likewise. * fold-const-call.c (fold_const_call_ss): Likewise. * fold-const.c (unextend): Likewise. (extract_muldiv_1): Likewise. (fold_single_bit_test): Likewise. (native_encode_int): Likewise. (native_encode_string): Likewise. (native_interpret_int): Likewise. * gimple-fold.c (gimple_fold_builtin_memset): Likewise. * internal-fn.c (expand_addsub_overflow): Likewise. (expand_neg_overflow): Likewise. (expand_mul_overflow): Likewise. (expand_arith_overflow): Likewise. * match.pd: Likewise. * stor-layout.c (layout_type): Likewise. * tree-cfg.c (verify_gimple_assign_ternary): Likewise. * tree-ssa-math-opts.c (convert_mult_to_widen): Likewise. * tree-ssanames.c (get_range_info): Likewise. * tree-switch-conversion.c (array_value_type) Likewise. * tree-vect-patterns.c (vect_recog_rotate_pattern): Likewise. (vect_recog_divmod_pattern): Likewise. (vect_recog_mixed_size_cond_pattern): Likewise. * tree-vrp.c (extract_range_basic): Likewise. (simplify_float_conversion_using_ranges): Likewise. * tree.c (int_fits_type_p): Likewise. * ubsan.c (instrument_bool_enum_load): Likewise. * varasm.c (mergeable_string_section): Likewise. (narrowing_initializer_constant_valid_p): Likewise. (output_constant): Likewise. gcc/cp/ * cvt.c (cp_convert_to_pointer): Use SCALAR_INT_TYPE_MODE. gcc/fortran/ * target-memory.c (size_integer): Use SCALAR_INT_TYPE_MODE. (size_logical): Likewise. gcc/objc/ * objc-encoding.c (encode_type): Use SCALAR_INT_TYPE_MODE. Index: gcc/tree.h =================================================================== --- gcc/tree.h 2017-07-13 09:18:24.776086502 +0100 +++ gcc/tree.h 2017-07-13 09:18:38.668812030 +0100 @@ -1852,6 +1852,8 @@ #define TYPE_MODE_RAW(NODE) (TYPE_CHECK #define TYPE_MODE(NODE) \ (VECTOR_TYPE_P (TYPE_CHECK (NODE)) \ ? vector_type_mode (NODE) : (NODE)->type_common.mode) +#define SCALAR_INT_TYPE_MODE(NODE) \ + (as_a (TYPE_CHECK (NODE)->type_common.mode)) #define SCALAR_FLOAT_TYPE_MODE(NODE) \ (as_a (TYPE_CHECK (NODE)->type_common.mode)) #define SET_TYPE_MODE(NODE, MODE) \ Index: gcc/builtins.c =================================================================== --- gcc/builtins.c 2017-07-13 09:18:30.027582784 +0100 +++ gcc/builtins.c 2017-07-13 09:18:38.655813141 +0100 @@ -5378,7 +5378,7 @@ expand_builtin_signbit (tree exp, rtx ta arg = CALL_EXPR_ARG (exp, 0); fmode = SCALAR_FLOAT_TYPE_MODE (TREE_TYPE (arg)); - rmode = TYPE_MODE (TREE_TYPE (exp)); + rmode = SCALAR_INT_TYPE_MODE (TREE_TYPE (exp)); fmt = REAL_MODE_FORMAT (fmode); arg = builtin_save_expr (arg); Index: gcc/cfgexpand.c =================================================================== --- gcc/cfgexpand.c 2017-07-13 09:18:33.650251357 +0100 +++ gcc/cfgexpand.c 2017-07-13 09:18:38.656813056 +0100 @@ -4137,7 +4137,7 @@ expand_debug_expr (tree exp) machine_mode inner_mode = VOIDmode; int unsignedp = TYPE_UNSIGNED (TREE_TYPE (exp)); addr_space_t as; - scalar_int_mode op0_mode, op1_mode; + scalar_int_mode op0_mode, op1_mode, addr_mode; switch (TREE_CODE_CLASS (TREE_CODE (exp))) { @@ -4912,7 +4912,8 @@ expand_debug_expr (tree exp) } as = TYPE_ADDR_SPACE (TREE_TYPE (TREE_TYPE (exp))); - op0 = convert_debug_memory_address (mode, XEXP (op0, 0), as); + addr_mode = SCALAR_INT_TYPE_MODE (TREE_TYPE (exp)); + op0 = convert_debug_memory_address (addr_mode, XEXP (op0, 0), as); return op0; Index: gcc/dojump.c =================================================================== --- gcc/dojump.c 2017-07-13 09:18:31.693428873 +0100 +++ gcc/dojump.c 2017-07-13 09:18:38.657812970 +0100 @@ -571,7 +571,7 @@ do_jump (tree exp, rtx_code_label *if_fa if (TREE_CODE (shift) == INTEGER_CST && compare_tree_int (shift, 0) >= 0 && compare_tree_int (shift, HOST_BITS_PER_WIDE_INT) < 0 - && prefer_and_bit_test (TYPE_MODE (argtype), + && prefer_and_bit_test (SCALAR_INT_TYPE_MODE (argtype), TREE_INT_CST_LOW (shift))) { unsigned HOST_WIDE_INT mask @@ -1190,17 +1190,14 @@ do_compare_and_jump (tree treeop0, tree return; type = TREE_TYPE (treeop0); - mode = TYPE_MODE (type); if (TREE_CODE (treeop0) == INTEGER_CST && (TREE_CODE (treeop1) != INTEGER_CST - || (GET_MODE_BITSIZE (mode) - > GET_MODE_BITSIZE (TYPE_MODE (TREE_TYPE (treeop1)))))) - { - /* op0 might have been replaced by promoted constant, in which - case the type of second argument should be used. */ - type = TREE_TYPE (treeop1); - mode = TYPE_MODE (type); - } + || (GET_MODE_BITSIZE (SCALAR_INT_TYPE_MODE (type)) + > GET_MODE_BITSIZE (SCALAR_INT_TYPE_MODE (TREE_TYPE (treeop1)))))) + /* op0 might have been replaced by promoted constant, in which + case the type of second argument should be used. */ + type = TREE_TYPE (treeop1); + mode = TYPE_MODE (type); unsignedp = TYPE_UNSIGNED (type); code = unsignedp ? unsigned_code : signed_code; Index: gcc/dwarf2cfi.c =================================================================== --- gcc/dwarf2cfi.c 2017-06-30 12:50:38.644644197 +0100 +++ gcc/dwarf2cfi.c 2017-07-13 09:18:38.657812970 +0100 @@ -302,7 +302,7 @@ void init_one_dwarf_reg_size (int regno, expand_builtin_init_dwarf_reg_sizes (tree address) { unsigned int i; - machine_mode mode = TYPE_MODE (char_type_node); + scalar_int_mode mode = SCALAR_INT_TYPE_MODE (char_type_node); rtx addr = expand_normal (address); rtx mem = gen_rtx_MEM (BLKmode, addr); Index: gcc/expmed.c =================================================================== --- gcc/expmed.c 2017-07-13 09:18:32.525352977 +0100 +++ gcc/expmed.c 2017-07-13 09:18:38.658812885 +0100 @@ -5195,7 +5195,7 @@ make_tree (tree type, rtx x) address mode to pointer mode. */ if (POINTER_TYPE_P (type)) x = convert_memory_address_addr_space - (TYPE_MODE (type), x, TYPE_ADDR_SPACE (TREE_TYPE (type))); + (SCALAR_INT_TYPE_MODE (type), x, TYPE_ADDR_SPACE (TREE_TYPE (type))); /* Note that we do *not* use SET_DECL_RTL here, because we do not want set_decl_rtl to go adjusting REG_ATTRS for this temporary. */ Index: gcc/expr.c =================================================================== --- gcc/expr.c 2017-07-13 09:18:38.043865449 +0100 +++ gcc/expr.c 2017-07-13 09:18:38.659812799 +0100 @@ -9070,11 +9070,12 @@ #define REDUCE_BIT_FIELD(expr) (reduce_b instead. */ if (reduce_bit_field && TYPE_UNSIGNED (type)) { + int_mode = SCALAR_INT_TYPE_MODE (type); wide_int mask = wi::mask (TYPE_PRECISION (type), - false, GET_MODE_PRECISION (mode)); + false, GET_MODE_PRECISION (int_mode)); - temp = expand_binop (mode, xor_optab, op0, - immed_wide_int_const (mask, mode), + temp = expand_binop (int_mode, xor_optab, op0, + immed_wide_int_const (mask, int_mode), target, 1, OPTAB_LIB_WIDEN); } else @@ -9175,7 +9176,7 @@ #define REDUCE_BIT_FIELD(expr) (reduce_b if (is_gimple_assign (def) && gimple_assign_rhs_code (def) == NOP_EXPR) { - machine_mode rmode = TYPE_MODE + scalar_int_mode rmode = SCALAR_INT_TYPE_MODE (TREE_TYPE (gimple_assign_rhs1 (def))); if (GET_MODE_SIZE (rmode) < GET_MODE_SIZE (int_mode) @@ -9943,15 +9944,16 @@ expand_expr_real_1 (tree exp, rtx target return decl_rtl; case INTEGER_CST: - /* Given that TYPE_PRECISION (type) is not always equal to - GET_MODE_PRECISION (TYPE_MODE (type)), we need to extend from - the former to the latter according to the signedness of the - type. */ - temp = immed_wide_int_const (wi::to_wide - (exp, - GET_MODE_PRECISION (TYPE_MODE (type))), - TYPE_MODE (type)); - return temp; + { + /* Given that TYPE_PRECISION (type) is not always equal to + GET_MODE_PRECISION (TYPE_MODE (type)), we need to extend from + the former to the latter according to the signedness of the + type. */ + scalar_int_mode mode = SCALAR_INT_TYPE_MODE (type); + temp = immed_wide_int_const + (wi::to_wide (exp, GET_MODE_PRECISION (mode)), mode); + return temp; + } case VECTOR_CST: { @@ -10410,7 +10412,8 @@ expand_expr_real_1 (tree exp, rtx target if (DECL_BIT_FIELD (field)) { HOST_WIDE_INT bitsize = TREE_INT_CST_LOW (DECL_SIZE (field)); - machine_mode imode = TYPE_MODE (TREE_TYPE (field)); + scalar_int_mode imode + = SCALAR_INT_TYPE_MODE (TREE_TYPE (field)); if (TYPE_UNSIGNED (TREE_TYPE (field))) { @@ -11540,10 +11543,10 @@ try_casesi (tree index_type, tree index_ if (! targetm.have_casesi ()) return 0; - /* Convert the index to SImode. */ - if (GET_MODE_BITSIZE (TYPE_MODE (index_type)) > GET_MODE_BITSIZE (index_mode)) + /* The index must be some form of integer. Convert it to SImode. */ + scalar_int_mode omode = SCALAR_INT_TYPE_MODE (index_type); + if (GET_MODE_BITSIZE (omode) > GET_MODE_BITSIZE (index_mode)) { - machine_mode omode = TYPE_MODE (index_type); rtx rangertx = expand_normal (range); /* We must handle the endpoints in the original mode. */ @@ -11560,7 +11563,7 @@ try_casesi (tree index_type, tree index_ } else { - if (TYPE_MODE (index_type) != index_mode) + if (omode != index_mode) { index_type = lang_hooks.types.type_for_mode (index_mode, 0); index_expr = fold_convert (index_type, index_expr); Index: gcc/fold-const-call.c =================================================================== --- gcc/fold-const-call.c 2017-02-23 19:54:15.000000000 +0000 +++ gcc/fold-const-call.c 2017-07-13 09:18:38.659812799 +0100 @@ -844,7 +844,8 @@ fold_const_call_ss (wide_int *result, co int tmp; if (wi::ne_p (arg, 0)) tmp = wi::clz (arg); - else if (! CLZ_DEFINED_VALUE_AT_ZERO (TYPE_MODE (arg_type), tmp)) + else if (!CLZ_DEFINED_VALUE_AT_ZERO (SCALAR_INT_TYPE_MODE (arg_type), + tmp)) tmp = TYPE_PRECISION (arg_type); *result = wi::shwi (tmp, precision); return true; @@ -855,7 +856,8 @@ fold_const_call_ss (wide_int *result, co int tmp; if (wi::ne_p (arg, 0)) tmp = wi::ctz (arg); - else if (! CTZ_DEFINED_VALUE_AT_ZERO (TYPE_MODE (arg_type), tmp)) + else if (!CTZ_DEFINED_VALUE_AT_ZERO (SCALAR_INT_TYPE_MODE (arg_type), + tmp)) tmp = TYPE_PRECISION (arg_type); *result = wi::shwi (tmp, precision); return true; Index: gcc/fold-const.c =================================================================== --- gcc/fold-const.c 2017-07-13 09:18:31.699428322 +0100 +++ gcc/fold-const.c 2017-07-13 09:18:38.661812628 +0100 @@ -5471,7 +5471,7 @@ fold_range_test (location_t loc, enum tr unextend (tree c, int p, int unsignedp, tree mask) { tree type = TREE_TYPE (c); - int modesize = GET_MODE_BITSIZE (TYPE_MODE (type)); + int modesize = GET_MODE_BITSIZE (SCALAR_INT_TYPE_MODE (type)); tree temp; if (p == modesize || unsignedp) @@ -6061,8 +6061,9 @@ extract_muldiv_1 (tree t, tree c, enum t { tree type = TREE_TYPE (t); enum tree_code tcode = TREE_CODE (t); - tree ctype = (wide_type != 0 && (GET_MODE_SIZE (TYPE_MODE (wide_type)) - > GET_MODE_SIZE (TYPE_MODE (type))) + tree ctype = (wide_type != 0 + && (GET_MODE_SIZE (SCALAR_INT_TYPE_MODE (wide_type)) + > GET_MODE_SIZE (SCALAR_INT_TYPE_MODE (type))) ? wide_type : type); tree t1, t2; int same_p = tcode == code; @@ -6757,7 +6758,7 @@ fold_single_bit_test (location_t loc, en tree inner = TREE_OPERAND (arg0, 0); tree type = TREE_TYPE (arg0); int bitnum = tree_log2 (TREE_OPERAND (arg0, 1)); - machine_mode operand_mode = TYPE_MODE (type); + scalar_int_mode operand_mode = SCALAR_INT_TYPE_MODE (type); int ops_unsigned; tree signed_type, unsigned_type, intermediate_type; tree tem, one; @@ -7068,7 +7069,7 @@ fold_plusminus_mult_expr (location_t loc native_encode_int (const_tree expr, unsigned char *ptr, int len, int off) { tree type = TREE_TYPE (expr); - int total_bytes = GET_MODE_SIZE (TYPE_MODE (type)); + int total_bytes = GET_MODE_SIZE (SCALAR_INT_TYPE_MODE (type)); int byte, offset, word, words; unsigned char value; @@ -7278,7 +7279,8 @@ native_encode_string (const_tree expr, u if (TREE_CODE (type) != ARRAY_TYPE || TREE_CODE (TREE_TYPE (type)) != INTEGER_TYPE - || GET_MODE_BITSIZE (TYPE_MODE (TREE_TYPE (type))) != BITS_PER_UNIT + || (GET_MODE_BITSIZE (SCALAR_INT_TYPE_MODE (TREE_TYPE (type))) + != BITS_PER_UNIT) || !tree_fits_shwi_p (TYPE_SIZE_UNIT (type))) return 0; total_bytes = tree_to_shwi (TYPE_SIZE_UNIT (type)); @@ -7350,7 +7352,7 @@ native_encode_expr (const_tree expr, uns static tree native_interpret_int (tree type, const unsigned char *ptr, int len) { - int total_bytes = GET_MODE_SIZE (TYPE_MODE (type)); + int total_bytes = GET_MODE_SIZE (SCALAR_INT_TYPE_MODE (type)); if (total_bytes > len || total_bytes * BITS_PER_UNIT > HOST_BITS_PER_DOUBLE_INT) Index: gcc/gimple-fold.c =================================================================== --- gcc/gimple-fold.c 2017-07-13 09:18:34.110210088 +0100 +++ gcc/gimple-fold.c 2017-07-13 09:18:38.661812628 +0100 @@ -1197,7 +1197,7 @@ gimple_fold_builtin_memset (gimple_stmt_ return NULL_TREE; length = tree_to_uhwi (len); - if (GET_MODE_SIZE (TYPE_MODE (etype)) != length + if (GET_MODE_SIZE (SCALAR_INT_TYPE_MODE (etype)) != length || get_pointer_alignment (dest) / BITS_PER_UNIT < length) return NULL_TREE; Index: gcc/internal-fn.c =================================================================== --- gcc/internal-fn.c 2017-07-13 09:18:30.902501597 +0100 +++ gcc/internal-fn.c 2017-07-13 09:18:38.662812543 +0100 @@ -635,7 +635,7 @@ expand_addsub_overflow (location_t loc, do_pending_stack_adjust (); rtx op0 = expand_normal (arg0); rtx op1 = expand_normal (arg1); - machine_mode mode = TYPE_MODE (TREE_TYPE (arg0)); + scalar_int_mode mode = SCALAR_INT_TYPE_MODE (TREE_TYPE (arg0)); int prec = GET_MODE_PRECISION (mode); rtx sgn = immed_wide_int_const (wi::min_value (prec, SIGNED), mode); bool do_xor = false; @@ -1085,7 +1085,7 @@ expand_neg_overflow (location_t loc, tre do_pending_stack_adjust (); op1 = expand_normal (arg1); - machine_mode mode = TYPE_MODE (TREE_TYPE (arg1)); + scalar_int_mode mode = SCALAR_INT_TYPE_MODE (TREE_TYPE (arg1)); if (lhs) { target = expand_expr (lhs, NULL_RTX, VOIDmode, EXPAND_WRITE); @@ -1179,7 +1179,7 @@ expand_mul_overflow (location_t loc, tre op0 = expand_normal (arg0); op1 = expand_normal (arg1); - machine_mode mode = TYPE_MODE (TREE_TYPE (arg0)); + scalar_int_mode mode = SCALAR_INT_TYPE_MODE (TREE_TYPE (arg0)); bool uns = unsr_p; if (lhs) { @@ -2106,7 +2106,7 @@ expand_arith_overflow (enum tree_code co /* The infinity precision result will always fit into result. */ rtx target = expand_expr (lhs, NULL_RTX, VOIDmode, EXPAND_WRITE); write_complex_part (target, const0_rtx, true); - machine_mode mode = TYPE_MODE (type); + scalar_int_mode mode = SCALAR_INT_TYPE_MODE (type); struct separate_ops ops; ops.code = code; ops.type = type; Index: gcc/match.pd =================================================================== --- gcc/match.pd 2017-06-30 12:50:38.246662537 +0100 +++ gcc/match.pd 2017-07-13 09:18:38.662812543 +0100 @@ -3238,7 +3238,7 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT) associated with the mode of @1, so the sign bit is specified by this mode. Check that @1 is the signed max associated with this sign bit. */ - && prec == GET_MODE_PRECISION (TYPE_MODE (arg1_type)) + && prec == GET_MODE_PRECISION (SCALAR_INT_TYPE_MODE (arg1_type)) /* signed_type does not work on pointer types. */ && INTEGRAL_TYPE_P (arg1_type)) /* The following case also applies to X < signed_max+1 Index: gcc/stor-layout.c =================================================================== --- gcc/stor-layout.c 2017-07-13 09:18:38.044865363 +0100 +++ gcc/stor-layout.c 2017-07-13 09:18:38.663812457 +0100 @@ -2245,7 +2245,7 @@ layout_type (tree type) case POINTER_TYPE: case REFERENCE_TYPE: { - machine_mode mode = TYPE_MODE (type); + scalar_int_mode mode = SCALAR_INT_TYPE_MODE (type); TYPE_SIZE (type) = bitsize_int (GET_MODE_BITSIZE (mode)); TYPE_SIZE_UNIT (type) = size_int (GET_MODE_SIZE (mode)); TYPE_UNSIGNED (type) = 1; Index: gcc/tree-cfg.c =================================================================== --- gcc/tree-cfg.c 2017-07-03 14:21:23.797508542 +0100 +++ gcc/tree-cfg.c 2017-07-13 09:18:38.664812372 +0100 @@ -4189,7 +4189,7 @@ verify_gimple_assign_ternary (gassign *s } if (TREE_CODE (TREE_TYPE (rhs3_type)) != INTEGER_TYPE - || GET_MODE_BITSIZE (TYPE_MODE (TREE_TYPE (rhs3_type))) + || GET_MODE_BITSIZE (SCALAR_INT_TYPE_MODE (TREE_TYPE (rhs3_type))) != GET_MODE_BITSIZE (TYPE_MODE (TREE_TYPE (rhs1_type)))) { error ("invalid mask type in vector permute expression"); Index: gcc/tree-ssa-math-opts.c =================================================================== --- gcc/tree-ssa-math-opts.c 2017-07-13 09:18:22.939277409 +0100 +++ gcc/tree-ssa-math-opts.c 2017-07-13 09:18:38.664812372 +0100 @@ -3133,8 +3133,8 @@ convert_mult_to_widen (gimple *stmt, gim if (!is_widening_mult_p (stmt, &type1, &rhs1, &type2, &rhs2)) return false; - to_mode = TYPE_MODE (type); - from_mode = TYPE_MODE (type1); + to_mode = SCALAR_INT_TYPE_MODE (type); + from_mode = SCALAR_INT_TYPE_MODE (type1); from_unsigned1 = TYPE_UNSIGNED (type1); from_unsigned2 = TYPE_UNSIGNED (type2); Index: gcc/tree-ssanames.c =================================================================== --- gcc/tree-ssanames.c 2017-07-02 09:32:32.689745274 +0100 +++ gcc/tree-ssanames.c 2017-07-13 09:18:38.664812372 +0100 @@ -405,7 +405,7 @@ get_range_info (const_tree name, wide_in /* Return VR_VARYING for SSA_NAMEs with NULL RANGE_INFO or SSA_NAMEs with integral types width > 2 * HOST_BITS_PER_WIDE_INT precision. */ - if (!ri || (GET_MODE_PRECISION (TYPE_MODE (TREE_TYPE (name))) + if (!ri || (GET_MODE_PRECISION (SCALAR_INT_TYPE_MODE (TREE_TYPE (name))) > 2 * HOST_BITS_PER_WIDE_INT)) return VR_VARYING; Index: gcc/tree-switch-conversion.c =================================================================== --- gcc/tree-switch-conversion.c 2017-07-13 09:18:22.939277409 +0100 +++ gcc/tree-switch-conversion.c 2017-07-13 09:18:38.665812287 +0100 @@ -1047,7 +1047,7 @@ array_value_type (gswitch *swtch, tree t if (!INTEGRAL_TYPE_P (type)) return type; - machine_mode type_mode = TYPE_MODE (type); + scalar_int_mode type_mode = SCALAR_INT_TYPE_MODE (type); machine_mode mode = get_narrowest_mode (type_mode); if (GET_MODE_SIZE (type_mode) <= GET_MODE_SIZE (mode)) return type; @@ -1094,8 +1094,8 @@ array_value_type (gswitch *swtch, tree t if (sign == 0) sign = TYPE_UNSIGNED (type) ? 1 : -1; smaller_type = lang_hooks.types.type_for_mode (mode, sign >= 0); - if (GET_MODE_SIZE (TYPE_MODE (type)) - <= GET_MODE_SIZE (TYPE_MODE (smaller_type))) + if (GET_MODE_SIZE (type_mode) + <= GET_MODE_SIZE (SCALAR_INT_TYPE_MODE (smaller_type))) return type; return smaller_type; Index: gcc/tree-vect-patterns.c =================================================================== --- gcc/tree-vect-patterns.c 2017-07-03 14:36:01.960352449 +0100 +++ gcc/tree-vect-patterns.c 2017-07-13 09:18:38.665812287 +0100 @@ -1882,13 +1882,14 @@ vect_recog_rotate_pattern (vec } def = NULL_TREE; + scalar_int_mode mode = SCALAR_INT_TYPE_MODE (type); if (TREE_CODE (oprnd1) == INTEGER_CST - || TYPE_MODE (TREE_TYPE (oprnd1)) == TYPE_MODE (type)) + || TYPE_MODE (TREE_TYPE (oprnd1)) == mode) def = oprnd1; else if (def_stmt && gimple_assign_cast_p (def_stmt)) { tree rhs1 = gimple_assign_rhs1 (def_stmt); - if (TYPE_MODE (TREE_TYPE (rhs1)) == TYPE_MODE (type) + if (TYPE_MODE (TREE_TYPE (rhs1)) == mode && TYPE_PRECISION (TREE_TYPE (rhs1)) == TYPE_PRECISION (type)) def = rhs1; @@ -1909,16 +1910,16 @@ vect_recog_rotate_pattern (vec append_pattern_def_seq (stmt_vinfo, def_stmt); } stype = TREE_TYPE (def); + scalar_int_mode smode = SCALAR_INT_TYPE_MODE (stype); if (TREE_CODE (def) == INTEGER_CST) { if (!tree_fits_uhwi_p (def) - || tree_to_uhwi (def) >= GET_MODE_PRECISION (TYPE_MODE (type)) + || tree_to_uhwi (def) >= GET_MODE_PRECISION (mode) || integer_zerop (def)) return NULL; def2 = build_int_cst (stype, - GET_MODE_PRECISION (TYPE_MODE (type)) - - tree_to_uhwi (def)); + GET_MODE_PRECISION (mode) - tree_to_uhwi (def)); } else { @@ -1944,8 +1945,7 @@ vect_recog_rotate_pattern (vec } def2 = vect_recog_temp_ssa_var (stype, NULL); - tree mask - = build_int_cst (stype, GET_MODE_PRECISION (TYPE_MODE (stype)) - 1); + tree mask = build_int_cst (stype, GET_MODE_PRECISION (smode) - 1); def_stmt = gimple_build_assign (def2, BIT_AND_EXPR, gimple_assign_lhs (def_stmt), mask); if (ext_def) @@ -2588,6 +2588,7 @@ vect_recog_divmod_pattern (vec || TYPE_PRECISION (itype) != GET_MODE_PRECISION (TYPE_MODE (itype))) return NULL; + scalar_int_mode itype_mode = SCALAR_INT_TYPE_MODE (itype); vectype = get_vectype_for_scalar_type (itype); if (vectype == NULL_TREE) return NULL; @@ -2655,7 +2656,7 @@ vect_recog_divmod_pattern (vec = build_nonstandard_integer_type (prec, 1); tree vecutype = get_vectype_for_scalar_type (utype); tree shift - = build_int_cst (utype, GET_MODE_BITSIZE (TYPE_MODE (itype)) + = build_int_cst (utype, GET_MODE_BITSIZE (itype_mode) - tree_log2 (oprnd1)); tree var = vect_recog_temp_ssa_var (utype, NULL); @@ -2721,7 +2722,7 @@ vect_recog_divmod_pattern (vec unsigned HOST_WIDE_INT mh, ml; int pre_shift, post_shift; unsigned HOST_WIDE_INT d = (TREE_INT_CST_LOW (oprnd1) - & GET_MODE_MASK (TYPE_MODE (itype))); + & GET_MODE_MASK (itype_mode)); tree t1, t2, t3, t4; if (d >= (HOST_WIDE_INT_1U << (prec - 1))) @@ -3066,7 +3067,8 @@ vect_recog_mixed_size_cond_pattern (vec< HOST_WIDE_INT cmp_mode_size = GET_MODE_UNIT_BITSIZE (TYPE_MODE (comp_vectype)); - if (GET_MODE_BITSIZE (TYPE_MODE (type)) == cmp_mode_size) + scalar_int_mode type_mode = SCALAR_INT_TYPE_MODE (type); + if (GET_MODE_BITSIZE (type_mode) == cmp_mode_size) return NULL; vectype = get_vectype_for_scalar_type (type); @@ -3091,7 +3093,7 @@ vect_recog_mixed_size_cond_pattern (vec< if (!expand_vec_cond_expr_p (vecitype, comp_vectype, TREE_CODE (cond_expr))) return NULL; - if (GET_MODE_BITSIZE (TYPE_MODE (type)) > cmp_mode_size) + if (GET_MODE_BITSIZE (type_mode) > cmp_mode_size) { if ((TREE_CODE (then_clause) == INTEGER_CST && !int_fits_type_p (then_clause, itype)) Index: gcc/tree-vrp.c =================================================================== --- gcc/tree-vrp.c 2017-07-13 09:18:38.045865278 +0100 +++ gcc/tree-vrp.c 2017-07-13 09:18:38.666812201 +0100 @@ -3567,6 +3567,7 @@ extract_range_basic (value_range *vr, gi int mini, maxi, zerov = 0, prec; enum tree_code subcode = ERROR_MARK; combined_fn cfn = gimple_call_combined_fn (stmt); + scalar_int_mode mode; switch (cfn) { @@ -3627,10 +3628,9 @@ extract_range_basic (value_range *vr, gi prec = TYPE_PRECISION (TREE_TYPE (arg)); mini = 0; maxi = prec; - if (optab_handler (clz_optab, TYPE_MODE (TREE_TYPE (arg))) - != CODE_FOR_nothing - && CLZ_DEFINED_VALUE_AT_ZERO (TYPE_MODE (TREE_TYPE (arg)), - zerov) + mode = SCALAR_INT_TYPE_MODE (TREE_TYPE (arg)); + if (optab_handler (clz_optab, mode) != CODE_FOR_nothing + && CLZ_DEFINED_VALUE_AT_ZERO (mode, zerov) /* Handle only the single common value. */ && zerov != prec) /* Magic value to give up, unless vr0 proves @@ -3679,10 +3679,9 @@ extract_range_basic (value_range *vr, gi prec = TYPE_PRECISION (TREE_TYPE (arg)); mini = 0; maxi = prec - 1; - if (optab_handler (ctz_optab, TYPE_MODE (TREE_TYPE (arg))) - != CODE_FOR_nothing - && CTZ_DEFINED_VALUE_AT_ZERO (TYPE_MODE (TREE_TYPE (arg)), - zerov)) + mode = SCALAR_INT_TYPE_MODE (TREE_TYPE (arg)); + if (optab_handler (ctz_optab, mode) != CODE_FOR_nothing + && CTZ_DEFINED_VALUE_AT_ZERO (mode, zerov)) { /* Handle only the two common values. */ if (zerov == -1) @@ -10102,13 +10101,13 @@ simplify_float_conversion_using_ranges ( return false; /* First check if we can use a signed type in place of an unsigned. */ + scalar_int_mode rhs_mode = SCALAR_INT_TYPE_MODE (TREE_TYPE (rhs1)); if (TYPE_UNSIGNED (TREE_TYPE (rhs1)) - && (can_float_p (fltmode, TYPE_MODE (TREE_TYPE (rhs1)), 0) - != CODE_FOR_nothing) + && can_float_p (fltmode, rhs_mode, 0) != CODE_FOR_nothing && range_fits_type_p (vr, TYPE_PRECISION (TREE_TYPE (rhs1)), SIGNED)) - mode = TYPE_MODE (TREE_TYPE (rhs1)); + mode = rhs_mode; /* If we can do the conversion in the current input mode do nothing. */ - else if (can_float_p (fltmode, TYPE_MODE (TREE_TYPE (rhs1)), + else if (can_float_p (fltmode, rhs_mode, TYPE_UNSIGNED (TREE_TYPE (rhs1))) != CODE_FOR_nothing) return false; /* Otherwise search for a mode we can use, starting from the narrowest Index: gcc/tree.c =================================================================== --- gcc/tree.c 2017-07-13 09:18:26.920877340 +0100 +++ gcc/tree.c 2017-07-13 09:18:38.667812116 +0100 @@ -9254,7 +9254,7 @@ int_fits_type_p (const_tree c, const_tre /* Third, unsigned integers with top bit set never fit signed types. */ if (!TYPE_UNSIGNED (type) && sgn_c == UNSIGNED) { - int prec = GET_MODE_PRECISION (TYPE_MODE (TREE_TYPE (c))) - 1; + int prec = GET_MODE_PRECISION (SCALAR_INT_TYPE_MODE (TREE_TYPE (c))) - 1; if (prec < TYPE_PRECISION (TREE_TYPE (c))) { /* When a tree_cst is converted to a wide-int, the precision Index: gcc/ubsan.c =================================================================== --- gcc/ubsan.c 2017-06-30 12:50:38.436653781 +0100 +++ gcc/ubsan.c 2017-07-13 09:18:38.668812030 +0100 @@ -1385,7 +1385,7 @@ instrument_bool_enum_load (gimple_stmt_i && TREE_TYPE (type) != NULL_TREE && TREE_CODE (TREE_TYPE (type)) == INTEGER_TYPE && (TYPE_PRECISION (TREE_TYPE (type)) - < GET_MODE_PRECISION (TYPE_MODE (type)))) + < GET_MODE_PRECISION (SCALAR_INT_TYPE_MODE (type)))) { minv = TYPE_MIN_VALUE (TREE_TYPE (type)); maxv = TYPE_MAX_VALUE (TREE_TYPE (type)); @@ -1393,7 +1393,7 @@ instrument_bool_enum_load (gimple_stmt_i else return; - int modebitsize = GET_MODE_BITSIZE (TYPE_MODE (type)); + int modebitsize = GET_MODE_BITSIZE (SCALAR_INT_TYPE_MODE (type)); HOST_WIDE_INT bitsize, bitpos; tree offset; machine_mode mode; @@ -1405,7 +1405,7 @@ instrument_bool_enum_load (gimple_stmt_i if ((VAR_P (base) && DECL_HARD_REGISTER (base)) || (bitpos % modebitsize) != 0 || bitsize != modebitsize - || GET_MODE_BITSIZE (TYPE_MODE (utype)) != modebitsize + || GET_MODE_BITSIZE (SCALAR_INT_TYPE_MODE (utype)) != modebitsize || TREE_CODE (gimple_assign_lhs (stmt)) != SSA_NAME) return; Index: gcc/varasm.c =================================================================== --- gcc/varasm.c 2017-07-13 09:18:25.331031958 +0100 +++ gcc/varasm.c 2017-07-13 09:18:38.669811945 +0100 @@ -783,7 +783,7 @@ mergeable_string_section (tree decl ATTR && (len = int_size_in_bytes (TREE_TYPE (decl))) > 0 && TREE_STRING_LENGTH (decl) >= len) { - machine_mode mode; + scalar_int_mode mode; unsigned int modesize; const char *str; HOST_WIDE_INT i; @@ -791,7 +791,7 @@ mergeable_string_section (tree decl ATTR const char *prefix = function_mergeable_rodata_prefix (); char *name = (char *) alloca (strlen (prefix) + 30); - mode = TYPE_MODE (TREE_TYPE (TREE_TYPE (decl))); + mode = SCALAR_INT_TYPE_MODE (TREE_TYPE (TREE_TYPE (decl))); modesize = GET_MODE_BITSIZE (mode); if (modesize >= 8 && modesize <= 256 && (modesize & (modesize - 1)) == 0) @@ -4280,8 +4280,8 @@ narrowing_initializer_constant_valid_p ( tree inner = TREE_OPERAND (op0, 0); if (inner == error_mark_node || ! INTEGRAL_MODE_P (TYPE_MODE (TREE_TYPE (inner))) - || (GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (op0))) - > GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (inner))))) + || (GET_MODE_SIZE (SCALAR_INT_TYPE_MODE (TREE_TYPE (op0))) + > GET_MODE_SIZE (SCALAR_INT_TYPE_MODE (TREE_TYPE (inner))))) break; op0 = inner; } @@ -4292,8 +4292,8 @@ narrowing_initializer_constant_valid_p ( tree inner = TREE_OPERAND (op1, 0); if (inner == error_mark_node || ! INTEGRAL_MODE_P (TYPE_MODE (TREE_TYPE (inner))) - || (GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (op1))) - > GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (inner))))) + || (GET_MODE_SIZE (SCALAR_INT_TYPE_MODE (TREE_TYPE (op1))) + > GET_MODE_SIZE (SCALAR_INT_TYPE_MODE (TREE_TYPE (inner))))) break; op1 = inner; } @@ -4718,7 +4718,7 @@ output_constant (tree exp, unsigned HOST if (TREE_CODE (exp) == NOP_EXPR && POINTER_TYPE_P (TREE_TYPE (exp)) && targetm.addr_space.valid_pointer_mode - (TYPE_MODE (TREE_TYPE (exp)), + (SCALAR_INT_TYPE_MODE (TREE_TYPE (exp)), TYPE_ADDR_SPACE (TREE_TYPE (TREE_TYPE (exp))))) { tree saved_type = TREE_TYPE (exp); @@ -4728,7 +4728,7 @@ output_constant (tree exp, unsigned HOST while (TREE_CODE (exp) == NOP_EXPR && POINTER_TYPE_P (TREE_TYPE (exp)) && targetm.addr_space.valid_pointer_mode - (TYPE_MODE (TREE_TYPE (exp)), + (SCALAR_INT_TYPE_MODE (TREE_TYPE (exp)), TYPE_ADDR_SPACE (TREE_TYPE (TREE_TYPE (exp))))) exp = TREE_OPERAND (exp, 0); Index: gcc/cp/cvt.c =================================================================== --- gcc/cp/cvt.c 2017-06-12 17:05:22.947756422 +0100 +++ gcc/cp/cvt.c 2017-07-13 09:18:38.656813056 +0100 @@ -234,8 +234,8 @@ cp_convert_to_pointer (tree type, tree e /* Modes may be different but sizes should be the same. There is supposed to be some integral type that is the same width as a pointer. */ - gcc_assert (GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (expr))) - == GET_MODE_SIZE (TYPE_MODE (type))); + gcc_assert (GET_MODE_SIZE (SCALAR_INT_TYPE_MODE (TREE_TYPE (expr))) + == GET_MODE_SIZE (SCALAR_INT_TYPE_MODE (type))); return convert_to_pointer_maybe_fold (type, expr, dofold); } Index: gcc/fortran/target-memory.c =================================================================== --- gcc/fortran/target-memory.c 2017-07-13 09:18:24.774086700 +0100 +++ gcc/fortran/target-memory.c 2017-07-13 09:18:38.661812628 +0100 @@ -39,7 +39,7 @@ Software Foundation; either version 3, o static size_t size_integer (int kind) { - return GET_MODE_SIZE (TYPE_MODE (gfc_get_int_type (kind)));; + return GET_MODE_SIZE (SCALAR_INT_TYPE_MODE (gfc_get_int_type (kind))); } @@ -60,7 +60,7 @@ size_complex (int kind) static size_t size_logical (int kind) { - return GET_MODE_SIZE (TYPE_MODE (gfc_get_logical_type (kind)));; + return GET_MODE_SIZE (SCALAR_INT_TYPE_MODE (gfc_get_logical_type (kind))); } Index: gcc/objc/objc-encoding.c =================================================================== --- gcc/objc/objc-encoding.c 2017-07-13 09:18:24.775086601 +0100 +++ gcc/objc/objc-encoding.c 2017-07-13 09:18:38.662812543 +0100 @@ -626,7 +626,7 @@ encode_type (tree type, int curtype, int case INTEGER_TYPE: { char c; - switch (GET_MODE_BITSIZE (TYPE_MODE (type))) + switch (GET_MODE_BITSIZE (SCALAR_INT_TYPE_MODE (type))) { case 8: c = TYPE_UNSIGNED (type) ? 'C' : 'c'; break; case 16: c = TYPE_UNSIGNED (type) ? 'S' : 's'; break;