diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-05-10 07:58:27 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-05-10 07:58:27 +0000 |
commit | 5a1fe2db4de27e5d885582b199332d5672e2da16 (patch) | |
tree | 1b55fc7996845f84a927496e5f0f6f7aa9d75d19 /gcc | |
parent | 7b46887f06a1be787421e8811cf92473b7d00ecd (diff) | |
download | gcc-5a1fe2db4de27e5d885582b199332d5672e2da16.tar.gz |
2012-05-10 Richard Guenther <rguenther@suse.de>
ada/
* gcc-interface/cuintp.c (UI_From_gnu): Remove TYPE_IS_SIZETYPE use.
c-family/
* c-common.c (c_sizeof_or_alignof_type): Remove assert and
adjust commentary about TYPE_IS_SIZETYPE types.
* tree.h (TYPE_IS_SIZETYPE): Remove.
* fold-const.c (int_const_binop_1): Remove TYPE_IS_SIZETYPE use.
(extract_muldiv_1): Likewise.
* gimple.c (gtc_visit): Likewise.
(gimple_types_compatible_p): Likewise.
(iterative_hash_canonical_type): Likewise.
(gimple_canonical_types_compatible_p): Likewise.
* gimplify.c (gimplify_one_sizepos): Likewise.
* print-tree.c (print_node): Likewise.
* stor-layout.c (initialize_sizetypes): Do not set TYPE_IS_SIZETYPE.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187363 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 13 | ||||
-rw-r--r-- | gcc/ada/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/ada/gcc-interface/cuintp.c | 5 | ||||
-rw-r--r-- | gcc/c-family/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/c-family/c-common.c | 8 | ||||
-rw-r--r-- | gcc/fold-const.c | 26 | ||||
-rw-r--r-- | gcc/gimple.c | 14 | ||||
-rw-r--r-- | gcc/gimplify.c | 22 | ||||
-rw-r--r-- | gcc/print-tree.c | 3 | ||||
-rw-r--r-- | gcc/stor-layout.c | 4 | ||||
-rw-r--r-- | gcc/tree.h | 11 |
11 files changed, 36 insertions, 79 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 40ff5a153c8..afe2c63f6d9 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,16 @@ +2012-05-10 Richard Guenther <rguenther@suse.de> + + * tree.h (TYPE_IS_SIZETYPE): Remove. + * fold-const.c (int_const_binop_1): Remove TYPE_IS_SIZETYPE use. + (extract_muldiv_1): Likewise. + * gimple.c (gtc_visit): Likewise. + (gimple_types_compatible_p): Likewise. + (iterative_hash_canonical_type): Likewise. + (gimple_canonical_types_compatible_p): Likewise. + * gimplify.c (gimplify_one_sizepos): Likewise. + * print-tree.c (print_node): Likewise. + * stor-layout.c (initialize_sizetypes): Do not set TYPE_IS_SIZETYPE. + 2012-05-09 Uros Bizjak <ubizjak@gmail.com> PR target/52908 diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index fa564b14f45..d24810fed89 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,7 @@ +2012-05-10 Richard Guenther <rguenther@suse.de> + + * gcc-interface/cuintp.c (UI_From_gnu): Remove TYPE_IS_SIZETYPE use. + 2012-05-06 Tristan Gingold <gingold@adacore.com> * gcc-interface/trans.c (gigi): Decorate reraise_zcx_decl. diff --git a/gcc/ada/gcc-interface/cuintp.c b/gcc/ada/gcc-interface/cuintp.c index 31ed801e63c..60cb26f65e7 100644 --- a/gcc/ada/gcc-interface/cuintp.c +++ b/gcc/ada/gcc-interface/cuintp.c @@ -177,10 +177,7 @@ UI_From_gnu (tree Input) in a signed 64-bit integer. */ if (host_integerp (Input, 0)) return UI_From_Int (TREE_INT_CST_LOW (Input)); - else if (TREE_INT_CST_HIGH (Input) < 0 - && TYPE_UNSIGNED (gnu_type) - && !(TREE_CODE (gnu_type) == INTEGER_TYPE - && TYPE_IS_SIZETYPE (gnu_type))) + else if (TREE_INT_CST_HIGH (Input) < 0 && TYPE_UNSIGNED (gnu_type)) return No_Uint; #endif diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index 52a7f5c9a40..f0e6147e3c5 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,3 +1,8 @@ +2012-05-10 Richard Guenther <rguenther@suse.de> + + * c-common.c (c_sizeof_or_alignof_type): Remove assert and + adjust commentary about TYPE_IS_SIZETYPE types. + 2012-05-09 Manuel López-Ibáñez <manu@gcc.gnu.org> PR c++/53261 diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c index 1cdef9a995c..a5ddbee63c8 100644 --- a/gcc/c-family/c-common.c +++ b/gcc/c-family/c-common.c @@ -4539,12 +4539,10 @@ c_sizeof_or_alignof_type (location_t loc, value = size_int (TYPE_ALIGN_UNIT (type)); } - /* VALUE will have an integer type with TYPE_IS_SIZETYPE set. - TYPE_IS_SIZETYPE means that certain things (like overflow) will - never happen. However, this node should really have type - `size_t', which is just a typedef for an ordinary integer type. */ + /* VALUE will have the middle-end integer type sizetype. + However, we should really return a value of type `size_t', + which is just a typedef for an ordinary integer type. */ value = fold_convert_loc (loc, size_type_node, value); - gcc_assert (!TYPE_IS_SIZETYPE (TREE_TYPE (value))); return value; } diff --git a/gcc/fold-const.c b/gcc/fold-const.c index 5bb75d490d9..c68db739ae9 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -940,8 +940,6 @@ int_const_binop_1 (enum tree_code code, const_tree arg1, const_tree arg2, tree t; tree type = TREE_TYPE (arg1); bool uns = TYPE_UNSIGNED (type); - bool is_sizetype - = (TREE_CODE (type) == INTEGER_TYPE && TYPE_IS_SIZETYPE (type)); bool overflow = false; op1 = tree_to_double_int (arg1); @@ -1077,7 +1075,7 @@ int_const_binop_1 (enum tree_code code, const_tree arg1, const_tree arg2, } t = force_fit_type_double (TREE_TYPE (arg1), res, overflowable, - ((!uns || is_sizetype) && overflow) + (!uns && overflow) | TREE_OVERFLOW (arg1) | TREE_OVERFLOW (arg2)); return t; @@ -5639,8 +5637,6 @@ extract_muldiv_1 (tree t, tree c, enum tree_code code, tree wide_type, /* ... and has wrapping overflow, and its type is smaller than ctype, then we cannot pass through as widening. */ && ((TYPE_OVERFLOW_WRAPS (TREE_TYPE (op0)) - && ! (TREE_CODE (TREE_TYPE (op0)) == INTEGER_TYPE - && TYPE_IS_SIZETYPE (TREE_TYPE (op0))) && (TYPE_PRECISION (ctype) > TYPE_PRECISION (TREE_TYPE (op0)))) /* ... or this is a truncation (t is narrower than op0), @@ -5818,7 +5814,6 @@ extract_muldiv_1 (tree t, tree c, enum tree_code code, tree wide_type, the operation since it will change the result if the original computation overflowed. */ if (TYPE_UNSIGNED (ctype) - && ! (TREE_CODE (ctype) == INTEGER_TYPE && TYPE_IS_SIZETYPE (ctype)) && ctype != type) break; @@ -5844,14 +5839,8 @@ extract_muldiv_1 (tree t, tree c, enum tree_code code, tree wide_type, (C * 8) % 4 since we know that's zero. */ if ((code == TRUNC_MOD_EXPR || code == CEIL_MOD_EXPR || code == FLOOR_MOD_EXPR || code == ROUND_MOD_EXPR) - /* If the multiplication can overflow we cannot optimize this. - ??? Until we can properly mark individual operations as - not overflowing we need to treat sizetype special here as - stor-layout relies on this opimization to make - DECL_FIELD_BIT_OFFSET always a constant. */ - && (TYPE_OVERFLOW_UNDEFINED (TREE_TYPE (t)) - || (TREE_CODE (TREE_TYPE (t)) == INTEGER_TYPE - && TYPE_IS_SIZETYPE (TREE_TYPE (t)))) + /* If the multiplication can overflow we cannot optimize this. */ + && TYPE_OVERFLOW_UNDEFINED (TREE_TYPE (t)) && TREE_CODE (TREE_OPERAND (t, 1)) == INTEGER_CST && integer_zerop (const_binop (TRUNC_MOD_EXPR, op1, c))) { @@ -5893,16 +5882,11 @@ extract_muldiv_1 (tree t, tree c, enum tree_code code, tree wide_type, (tree_to_double_int (c), TYPE_PRECISION (ctype), TYPE_UNSIGNED (ctype)), false, &overflow_p); - overflow_p = (((!TYPE_UNSIGNED (ctype) - || (TREE_CODE (ctype) == INTEGER_TYPE - && TYPE_IS_SIZETYPE (ctype))) - && overflow_p) + overflow_p = ((!TYPE_UNSIGNED (ctype) && overflow_p) | TREE_OVERFLOW (c) | TREE_OVERFLOW (op1)); if (!double_int_fits_to_tree_p (ctype, mul) && ((TYPE_UNSIGNED (ctype) && tcode != MULT_EXPR) - || !TYPE_UNSIGNED (ctype) - || (TREE_CODE (ctype) == INTEGER_TYPE - && TYPE_IS_SIZETYPE (ctype)))) + || !TYPE_UNSIGNED (ctype))) overflow_p = 1; if (!overflow_p) return fold_build2 (tcode, ctype, fold_convert (ctype, op0), diff --git a/gcc/gimple.c b/gcc/gimple.c index e8841ec65ae..79da12cde51 100644 --- a/gcc/gimple.c +++ b/gcc/gimple.c @@ -3326,8 +3326,7 @@ gtc_visit (tree t1, tree t2, return false; if (TREE_CODE (t1) == INTEGER_TYPE - && (TYPE_IS_SIZETYPE (t1) != TYPE_IS_SIZETYPE (t2) - || TYPE_STRING_FLAG (t1) != TYPE_STRING_FLAG (t2))) + && TYPE_STRING_FLAG (t1) != TYPE_STRING_FLAG (t2)) return false; /* That's all we need to check for float and fixed-point types. */ @@ -3756,8 +3755,7 @@ gimple_types_compatible_p (tree t1, tree t2) return false; if (TREE_CODE (t1) == INTEGER_TYPE - && (TYPE_IS_SIZETYPE (t1) != TYPE_IS_SIZETYPE (t2) - || TYPE_STRING_FLAG (t1) != TYPE_STRING_FLAG (t2))) + && TYPE_STRING_FLAG (t1) != TYPE_STRING_FLAG (t2)) return false; /* That's all we need to check for float and fixed-point types. */ @@ -4206,10 +4204,7 @@ iterative_hash_canonical_type (tree type, hashval_t val) /* For integer types hash the types min/max values and the string flag. */ if (TREE_CODE (type) == INTEGER_TYPE) - { - v = iterative_hash_hashval_t (TYPE_STRING_FLAG (type), v); - v = iterative_hash_hashval_t (TYPE_IS_SIZETYPE (type), v); - } + v = iterative_hash_hashval_t (TYPE_STRING_FLAG (type), v); /* For array types hash their domain and the string flag. */ if (TREE_CODE (type) == ARRAY_TYPE @@ -4425,8 +4420,7 @@ gimple_canonical_types_compatible_p (tree t1, tree t2) return false; if (TREE_CODE (t1) == INTEGER_TYPE - && (TYPE_IS_SIZETYPE (t1) != TYPE_IS_SIZETYPE (t2) - || TYPE_STRING_FLAG (t1) != TYPE_STRING_FLAG (t2))) + && TYPE_STRING_FLAG (t1) != TYPE_STRING_FLAG (t2)) return false; /* For canonical type comparisons we do not want to build SCCs diff --git a/gcc/gimplify.c b/gcc/gimplify.c index 74d78950203..811fa221fec 100644 --- a/gcc/gimplify.c +++ b/gcc/gimplify.c @@ -8098,7 +8098,7 @@ gimplify_type_sizes (tree type, gimple_seq *list_p) void gimplify_one_sizepos (tree *expr_p, gimple_seq *stmt_p) { - tree type, expr = *expr_p; + tree expr = *expr_p; /* We don't do anything if the value isn't there, is constant, or contains A PLACEHOLDER_EXPR. We also don't want to do anything if it's already @@ -8110,30 +8110,10 @@ gimplify_one_sizepos (tree *expr_p, gimple_seq *stmt_p) || CONTAINS_PLACEHOLDER_P (expr)) return; - type = TREE_TYPE (expr); *expr_p = unshare_expr (expr); gimplify_expr (expr_p, stmt_p, NULL, is_gimple_val, fb_rvalue); expr = *expr_p; - - /* Verify that we've an exact type match with the original expression. - In particular, we do not wish to drop a "sizetype" in favour of a - type of similar dimensions. We don't want to pollute the generic - type-stripping code with this knowledge because it doesn't matter - for the bulk of GENERIC/GIMPLE. It only matters that TYPE_SIZE_UNIT - and friends retain their "sizetype-ness". */ - if (TREE_TYPE (expr) != type - && TREE_CODE (type) == INTEGER_TYPE - && TYPE_IS_SIZETYPE (type)) - { - tree tmp; - gimple stmt; - - *expr_p = create_tmp_var (type, NULL); - tmp = build1 (NOP_EXPR, type, expr); - stmt = gimplify_assign (*expr_p, tmp, stmt_p); - gimple_set_location (stmt, EXPR_LOC_OR_HERE (expr)); - } } /* Gimplify the body of statements of FNDECL and return a GIMPLE_BIND node diff --git a/gcc/print-tree.c b/gcc/print-tree.c index 466b7db7469..28f51b06352 100644 --- a/gcc/print-tree.c +++ b/gcc/print-tree.c @@ -611,9 +611,6 @@ print_node (FILE *file, const char *prefix, tree node, int indent) || code == QUAL_UNION_TYPE) && TYPE_NO_FORCE_BLK (node)) fputs (" no-force-blk", file); - else if (code == INTEGER_TYPE - && TYPE_IS_SIZETYPE (node)) - fputs (" sizetype", file); if (TYPE_STRING_FLAG (node)) fputs (" string-flag", file); diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c index fb00b5f4bb2..842b506ab25 100644 --- a/gcc/stor-layout.c +++ b/gcc/stor-layout.c @@ -2479,12 +2479,10 @@ initialize_sizetypes (void) TYPE_NAME (sizetype) = get_identifier ("sizetype"); TYPE_PRECISION (sizetype) = precision; TYPE_UNSIGNED (sizetype) = 1; - TYPE_IS_SIZETYPE (sizetype) = 1; bitsizetype = make_node (INTEGER_TYPE); TYPE_NAME (bitsizetype) = get_identifier ("bitsizetype"); TYPE_PRECISION (bitsizetype) = bprecision; TYPE_UNSIGNED (bitsizetype) = 1; - TYPE_IS_SIZETYPE (bitsizetype) = 1; /* Now layout both types manually. */ SET_TYPE_MODE (sizetype, smallest_mode_for_size (precision, MODE_INT)); @@ -2505,10 +2503,8 @@ initialize_sizetypes (void) /* Create the signed variants of *sizetype. */ ssizetype = make_signed_type (TYPE_PRECISION (sizetype)); TYPE_NAME (ssizetype) = get_identifier ("ssizetype"); - TYPE_IS_SIZETYPE (ssizetype) = 1; sbitsizetype = make_signed_type (TYPE_PRECISION (bitsizetype)); TYPE_NAME (sbitsizetype) = get_identifier ("sbitsizetype"); - TYPE_IS_SIZETYPE (sbitsizetype) = 1; } /* TYPE is an integral type, i.e., an INTEGRAL_TYPE, ENUMERAL_TYPE diff --git a/gcc/tree.h b/gcc/tree.h index 9d53a14dd7b..419d8f4e638 100644 --- a/gcc/tree.h +++ b/gcc/tree.h @@ -2251,17 +2251,6 @@ extern enum machine_mode vector_type_mode (const_tree); #define TYPE_NO_FORCE_BLK(NODE) \ (TYPE_CHECK (NODE)->type_common.no_force_blk_flag) -/* In an INTEGER_TYPE, it means the type represents a size. We use - this both for validity checking and to permit optimizations that - are unsafe for other types. Note that the C `size_t' type should - *not* have this flag set. The `size_t' type is simply a typedef - for an ordinary integer type that happens to be the type of an - expression returned by `sizeof'; `size_t' has no special - properties. Expressions whose type have TYPE_IS_SIZETYPE set are - always actual sizes. */ -#define TYPE_IS_SIZETYPE(NODE) \ - (INTEGER_TYPE_CHECK (NODE)->type_common.no_force_blk_flag) - /* Nonzero in a type considered volatile as a whole. */ #define TYPE_VOLATILE(NODE) (TYPE_CHECK (NODE)->base.volatile_flag) |