From: rsandifo Date: Wed, 20 Nov 2013 15:28:07 +0000 (+0000) Subject: Remove some differences with trunk. X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=08f4222b0cb1569b2c7271c467941cad92bba6ec;p=thirdparty%2Fgcc.git Remove some differences with trunk. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/wide-int@205120 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/c-family/cilk.c b/gcc/c-family/cilk.c index a68ef304dd6a..a663c457302a 100644 --- a/gcc/c-family/cilk.c +++ b/gcc/c-family/cilk.c @@ -1208,7 +1208,7 @@ extract_free_variables (tree t, struct wrapper_data *wd, int ii = 0; if (TREE_CODE (TREE_OPERAND (t, 0)) == INTEGER_CST) { - len = tree_to_uhwi (TREE_OPERAND (t, 0)); + len = TREE_INT_CST_LOW (TREE_OPERAND (t, 0)); for (ii = 0; ii < len; ii++) extract_free_variables (TREE_OPERAND (t, ii), wd, ADD_READ); diff --git a/gcc/c/Make-lang.in b/gcc/c/Make-lang.in index e68000a82462..d79fc4f410c0 100644 --- a/gcc/c/Make-lang.in +++ b/gcc/c/Make-lang.in @@ -137,3 +137,4 @@ c.stageprofile: stageprofile-start -mv c/*$(objext) stageprofile/c c.stagefeedback: stagefeedback-start -mv c/*$(objext) stagefeedback/c + diff --git a/gcc/config/avr/avr.c b/gcc/config/avr/avr.c index f1241f4e0f20..e94e0d7bac82 100644 --- a/gcc/config/avr/avr.c +++ b/gcc/config/avr/avr.c @@ -12233,7 +12233,7 @@ avr_fold_builtin (tree fndecl, int n_args ATTRIBUTE_UNUSED, tree *arg, } tmap = wide_int_to_tree (map_type, arg[0]); - map = tree_to_uhwi (tmap); + map = TREE_INT_CST_LOW (tmap); if (TREE_CODE (tval) != INTEGER_CST && 0 == avr_map_metric (map, MAP_MASK_PREIMAGE_F)) diff --git a/gcc/config/nds32/nds32.c b/gcc/config/nds32/nds32.c index 80ca1f647b79..8582bbb218af 100644 --- a/gcc/config/nds32/nds32.c +++ b/gcc/config/nds32/nds32.c @@ -1276,7 +1276,7 @@ nds32_construct_isr_vectors_information (tree func_attrs, /* Pick up each vector id value. */ id = TREE_VALUE (id_list); /* Add vector_number_offset to get actual vector number. */ - vector_id = tree_to_uhwi (id) + vector_number_offset; + vector_id = TREE_INT_CST_LOW (id) + vector_number_offset; /* Enable corresponding vector and set function name. */ nds32_isr_vectors[vector_id].category = (intr) @@ -1318,7 +1318,7 @@ nds32_construct_isr_vectors_information (tree func_attrs, /* The total vectors = interrupt + exception numbers + reset. There are 8 exception and 1 reset in nds32 architecture. */ - nds32_isr_vectors[0].total_n_vectors = tree_to_uhwi (id) + 8 + 1; + nds32_isr_vectors[0].total_n_vectors = TREE_INT_CST_LOW (id) + 8 + 1; strcpy (nds32_isr_vectors[0].func_name, func_name); /* Retrieve nmi and warm function. */ diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index ff45b8f3a717..977adf6b7916 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -3804,7 +3804,7 @@ make_string_pack (tree value) tree charvec; tree argpack = make_node (NONTYPE_ARGUMENT_PACK); const char *str = TREE_STRING_POINTER (value); - int sz = tree_to_uhwi (TYPE_SIZE_UNIT (TREE_TYPE (TREE_TYPE (value)))); + int sz = TREE_INT_CST_LOW (TYPE_SIZE_UNIT (TREE_TYPE (TREE_TYPE (value)))); int len = TREE_STRING_LENGTH (value) / sz - 1; tree argvec = make_tree_vec (2); diff --git a/gcc/cp/vtable-class-hierarchy.c b/gcc/cp/vtable-class-hierarchy.c index 00d4feee0227..32f9541e43da 100644 --- a/gcc/cp/vtable-class-hierarchy.c +++ b/gcc/cp/vtable-class-hierarchy.c @@ -453,7 +453,7 @@ check_and_record_registered_pairs (tree vtable_decl, tree vptr_address, vptr_address = TREE_OPERAND (vptr_address, 0); if (TREE_OPERAND_LENGTH (vptr_address) > 1) - offset = tree_to_uhwi (TREE_OPERAND (vptr_address, 1)); + offset = TREE_INT_CST_LOW (TREE_OPERAND (vptr_address, 1)); else offset = 0; @@ -876,7 +876,7 @@ output_set_info (tree record_type, vec vtbl_ptr_array) vptr_name = IDENTIFIER_POINTER (DECL_NAME (arg0)); if (TREE_CODE (arg1) == INTEGER_CST) - vptr_offset = tree_to_uhwi (arg1); + vptr_offset = TREE_INT_CST_LOW (arg1); } snprintf (buffer, sizeof (buffer), "%s %s %s + %d\n", diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index a02e8aa0f1b6..1193e5e47548 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -15112,7 +15112,7 @@ insert_wide_int (const wide_int &val, unsigned char *dest, int elt_size) return; } - // We'd have to extend this code to support odd sizes. + /* We'd have to extend this code to support odd sizes. */ gcc_assert (elt_size % (HOST_BITS_PER_WIDE_INT/BITS_PER_UNIT) == 0); int n = elt_size / (HOST_BITS_PER_WIDE_INT/BITS_PER_UNIT); diff --git a/gcc/fold-const.c b/gcc/fold-const.c index a25dfffc72e7..74319e5448a1 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -13044,7 +13044,7 @@ fold_binary_loc (location_t loc, unsigned HOST_WIDE_INT log2 = tree_log2 (arg01); /* If (C2 << C1) doesn't overflow, then ((X >> C1) & C2) != 0 can be rewritten as (X & (C2 << C1)) != 0. */ - if ((log2 + tree_to_uhwi (arg001)) < prec) + if ((log2 + TREE_INT_CST_LOW (arg001)) < prec) { tem = fold_build2_loc (loc, LSHIFT_EXPR, itype, arg01, arg001); tem = fold_build2_loc (loc, BIT_AND_EXPR, itype, arg000, tem); @@ -16155,7 +16155,7 @@ fold_read_from_constant_string (tree exp) && (GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (TREE_TYPE (string)))) == 1)) return build_int_cst_type (TREE_TYPE (exp), (TREE_STRING_POINTER (string) - [tree_to_uhwi (index)])); + [TREE_INT_CST_LOW (index)])); } return NULL; } diff --git a/gcc/fortran/trans-common.c b/gcc/fortran/trans-common.c index bc54b9deea71..2266c1bfa566 100644 --- a/gcc/fortran/trans-common.c +++ b/gcc/fortran/trans-common.c @@ -400,8 +400,8 @@ build_common_decl (gfc_common_head *com, tree union_type, bool is_init) gfc_warning ("Named COMMON block '%s' at %L shall be of the " "same size as elsewhere (%lu vs %lu bytes)", com->name, &com->where, - (unsigned long) tree_to_uhwi (size), - (unsigned long) tree_to_uhwi (DECL_SIZE_UNIT (decl))); + (unsigned long) TREE_INT_CST_LOW (size), + (unsigned long) TREE_INT_CST_LOW (DECL_SIZE_UNIT (decl))); if (tree_int_cst_lt (DECL_SIZE_UNIT (decl), size)) { diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c index 7cf9bc18d38c..275a71ddf676 100644 --- a/gcc/fortran/trans-expr.c +++ b/gcc/fortran/trans-expr.c @@ -2645,8 +2645,8 @@ gfc_string_to_single_character (tree len, tree str, int kind) && TREE_CODE (TREE_OPERAND (TREE_OPERAND (str, 0), 0)) == STRING_CST && array_ref_low_bound (TREE_OPERAND (str, 0)) == TREE_OPERAND (TREE_OPERAND (str, 0), 1) - && tree_to_uhwi (len) > 1 - && tree_to_uhwi (len) + && TREE_INT_CST_LOW (len) > 1 + && TREE_INT_CST_LOW (len) == (unsigned HOST_WIDE_INT) TREE_STRING_LENGTH (TREE_OPERAND (TREE_OPERAND (str, 0), 0))) { diff --git a/gcc/genpreds.c b/gcc/genpreds.c index 976eb113a6bf..dbffa903a1df 100644 --- a/gcc/genpreds.c +++ b/gcc/genpreds.c @@ -810,6 +810,7 @@ add_constraint (const char *name, const char *regclass, { enum rtx_code appropriate_code = is_const_int ? CONST_INT : CONST_DOUBLE; + /* Consider relaxing this requirement in the future. */ if (regclass || GET_CODE (exp) != AND diff --git a/gcc/gimplify.c b/gcc/gimplify.c index faba41959b41..5c71d2c36050 100644 --- a/gcc/gimplify.c +++ b/gcc/gimplify.c @@ -2642,7 +2642,7 @@ gimple_boolify (tree expr) return expr; case ANNOTATE_EXPR: - if ((enum annot_expr_kind) tree_to_uhwi (TREE_OPERAND (expr, 1)) + if ((enum annot_expr_kind) TREE_INT_CST_LOW (TREE_OPERAND (expr, 1)) == annot_expr_ivdep_kind) { TREE_OPERAND (expr, 0) = gimple_boolify (TREE_OPERAND (expr, 0)); diff --git a/gcc/ipa-devirt.c b/gcc/ipa-devirt.c index b1efde7fbf4c..41e530082be6 100644 --- a/gcc/ipa-devirt.c +++ b/gcc/ipa-devirt.c @@ -209,7 +209,7 @@ hash_type_name (tree t) if (TREE_CODE (v) == POINTER_PLUS_EXPR) { - hash = TREE_INT_CST_ELT (TREE_OPERAND (v, 1), 0); + hash = TREE_INT_CST_LOW (TREE_OPERAND (v, 1)); v = TREE_OPERAND (TREE_OPERAND (v, 0), 0); } diff --git a/gcc/java/typeck.c b/gcc/java/typeck.c index 39ee4199908c..3a0aa3960a23 100644 --- a/gcc/java/typeck.c +++ b/gcc/java/typeck.c @@ -219,7 +219,7 @@ java_array_type_length (tree array_type) { tree high = TYPE_MAX_VALUE (index_type); if (TREE_CODE (high) == INTEGER_CST) - return tree_to_uhwi (high) + 1; + return TREE_INT_CST_LOW (high) + 1; } } return -1; diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c index fe50ca5769b5..2074a82829fc 100644 --- a/gcc/stor-layout.c +++ b/gcc/stor-layout.c @@ -1244,7 +1244,7 @@ place_field (record_layout_info rli, tree field) && ! integer_zerop (DECL_SIZE (field)) && tree_fits_uhwi_p (DECL_SIZE (field)) /* BUG!!! rli->offset is checked as unsigned but used as signed. */ - && tree_fits_shwi_p (rli->offset) + && tree_fits_uhwi_p (rli->offset) && tree_fits_uhwi_p (TYPE_SIZE (type))) { unsigned int type_align = TYPE_ALIGN (type); diff --git a/gcc/targhooks.c b/gcc/targhooks.c index 5c13fc339103..0a56eff68eff 100644 --- a/gcc/targhooks.c +++ b/gcc/targhooks.c @@ -276,6 +276,7 @@ default_cxx_guard_type (void) return long_long_integer_type_node; } + /* Returns the size of the cookie to use when allocating an array whose elements have the indicated TYPE. Assumes that it is already known that a cookie is needed. */ diff --git a/gcc/tree-pretty-print.c b/gcc/tree-pretty-print.c index fa0e98d2a9b2..fc1b31aa6964 100644 --- a/gcc/tree-pretty-print.c +++ b/gcc/tree-pretty-print.c @@ -2118,7 +2118,7 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags, case ANNOTATE_EXPR: pp_string (buffer, "ANNOTATE_EXPR <"); - switch ((enum annot_expr_kind) tree_to_shwi (TREE_OPERAND (node, 1))) + switch ((enum annot_expr_kind) TREE_INT_CST_LOW (TREE_OPERAND (node, 1))) { case annot_expr_ivdep_kind: pp_string (buffer, "ivdep, "); diff --git a/gcc/tree.c b/gcc/tree.c index 91c7b3acc52d..1821b8e5620d 100644 --- a/gcc/tree.c +++ b/gcc/tree.c @@ -6993,7 +6993,7 @@ HOST_WIDE_INT tree_to_shwi (const_tree t) { gcc_assert (tree_fits_shwi_p (t)); - return TREE_INT_CST_ELT (t, 0); + return TREE_INT_CST_LOW (t); } /* T is an INTEGER_CST whose numerical value (extended according to @@ -7004,7 +7004,7 @@ unsigned HOST_WIDE_INT tree_to_uhwi (const_tree t) { gcc_assert (tree_fits_uhwi_p (t)); - return TREE_INT_CST_ELT (t, 0); + return TREE_INT_CST_LOW (t); } /* Return the most significant (sign) bit of T. */ diff --git a/gcc/tree.h b/gcc/tree.h index ea6d2fe84884..d4ea3842264a 100644 --- a/gcc/tree.h +++ b/gcc/tree.h @@ -3697,14 +3697,14 @@ extern inline __attribute__ ((__gnu_inline__)) HOST_WIDE_INT tree_to_shwi (const_tree t) { gcc_assert (tree_fits_shwi_p (t)); - return TREE_INT_CST_ELT (t, 0); + return TREE_INT_CST_LOW (t); } extern inline __attribute__ ((__gnu_inline__)) unsigned HOST_WIDE_INT tree_to_uhwi (const_tree t) { gcc_assert (tree_fits_uhwi_p (t)); - return TREE_INT_CST_ELT (t, 0); + return TREE_INT_CST_LOW (t); } #endif extern int tree_int_cst_sgn (const_tree);