diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2009-09-21 05:55:22 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2009-09-21 05:55:22 +0000 |
commit | 473ebbc5827588b98d60d2089eb8c823e74bb5d8 (patch) | |
tree | 51af1a212be0bb000965f32bdc30d8b8569d4703 | |
parent | b31b556704d30cd6a32a6e973728483ae7984336 (diff) | |
download | gcc-473ebbc5827588b98d60d2089eb8c823e74bb5d8.zip gcc-473ebbc5827588b98d60d2089eb8c823e74bb5d8.tar.gz gcc-473ebbc5827588b98d60d2089eb8c823e74bb5d8.tar.bz2 |
* stor-layout.c (layout_type): Remove obsolete code.
From-SVN: r151913
-rw-r--r-- | gcc/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/stor-layout.c | 33 |
2 files changed, 10 insertions, 27 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1f06b5d..47c3dfb 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2009-09-21 Eric Botcazou <ebotcazou@adacore.com> + + * stor-layout.c (layout_type): Remove obsolete code. + 2009-09-20 H.J. Lu <hongjiu.lu@intel.com> PR middle-end/41395 diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c index 8ff286c..18360bb 100644 --- a/gcc/stor-layout.c +++ b/gcc/stor-layout.c @@ -1956,8 +1956,8 @@ layout_type (tree type) { tree ub = TYPE_MAX_VALUE (index); tree lb = TYPE_MIN_VALUE (index); + tree element_size = TYPE_SIZE (element); tree length; - tree element_size; /* The initial subtraction should happen in the original type so that (possible) negative values are handled appropriately. */ @@ -1968,23 +1968,6 @@ layout_type (tree type) TREE_TYPE (lb), ub, lb))); - /* Special handling for arrays of bits (for Chill). */ - element_size = TYPE_SIZE (element); - if (TYPE_PACKED (type) && INTEGRAL_TYPE_P (element) - && (integer_zerop (TYPE_MAX_VALUE (element)) - || integer_onep (TYPE_MAX_VALUE (element))) - && host_integerp (TYPE_MIN_VALUE (element), 1)) - { - HOST_WIDE_INT maxvalue - = tree_low_cst (TYPE_MAX_VALUE (element), 1); - HOST_WIDE_INT minvalue - = tree_low_cst (TYPE_MIN_VALUE (element), 1); - - if (maxvalue - minvalue == 1 - && (maxvalue == 1 || maxvalue == 0)) - element_size = integer_one_node; - } - /* If neither bound is a constant and sizetype is signed, make sure the size is never negative. We should really do this if *either* bound is non-constant, but this is the best @@ -1998,15 +1981,11 @@ layout_type (tree type) fold_convert (bitsizetype, length)); - /* If we know the size of the element, calculate the total - size directly, rather than do some division thing below. - This optimization helps Fortran assumed-size arrays - (where the size of the array is determined at runtime) - substantially. - Note that we can't do this in the case where the size of - the elements is one bit since TYPE_SIZE_UNIT cannot be - set correctly in that case. */ - if (TYPE_SIZE_UNIT (element) != 0 && ! integer_onep (element_size)) + /* If we know the size of the element, calculate the total size + directly, rather than do some division thing below. This + optimization helps Fortran assumed-size arrays (where the + size of the array is determined at runtime) substantially. */ + if (TYPE_SIZE_UNIT (element)) TYPE_SIZE_UNIT (type) = size_binop (MULT_EXPR, TYPE_SIZE_UNIT (element), length); } |