diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-10-18 08:36:28 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-10-18 08:36:28 +0000 |
commit | 0e3dfadd374c3045a926afa6d06af276cee2108d (patch) | |
tree | 6ac87ce50110858e62204b3bb3df8bca29b549ef | |
parent | 5d1f14a85591463a991efa8cec43bcb63fc8c0e2 (diff) | |
download | gcc-0e3dfadd374c3045a926afa6d06af276cee2108d.tar.gz |
2013-10-18 Richard Biener <rguenther@suse.de>
* stor-layout.c (layout_type): Do not change TYPE_PRECISION
or TYPE_UNSIGNED of integral types.
(set_min_and_max_values_for_integral_type): Leave TYPE_MIN/MAX_VALUE
NULL_TREE for zero-precision integral types.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@203813 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/stor-layout.c | 17 |
2 files changed, 14 insertions, 10 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 10be8130dfc..28b8e495f2a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2013-10-18 Richard Biener <rguenther@suse.de> + + * stor-layout.c (layout_type): Do not change TYPE_PRECISION + or TYPE_UNSIGNED of integral types. + (set_min_and_max_values_for_integral_type): Leave TYPE_MIN/MAX_VALUE + NULL_TREE for zero-precision integral types. + 2013-10-18 James Greenhalgh <james.greenhalgh@arm.com> * config/aarch64/arm_neon.h diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c index 6584b575e0f..20e577d8482 100644 --- a/gcc/stor-layout.c +++ b/gcc/stor-layout.c @@ -2052,18 +2052,9 @@ layout_type (tree type) of the language-specific code. */ gcc_unreachable (); - case BOOLEAN_TYPE: /* Used for Java, Pascal, and Chill. */ - if (TYPE_PRECISION (type) == 0) - TYPE_PRECISION (type) = 1; /* default to one byte/boolean. */ - - /* ... fall through ... */ - + case BOOLEAN_TYPE: case INTEGER_TYPE: case ENUMERAL_TYPE: - if (TREE_CODE (TYPE_MIN_VALUE (type)) == INTEGER_CST - && tree_int_cst_sgn (TYPE_MIN_VALUE (type)) >= 0) - TYPE_UNSIGNED (type) = 1; - SET_TYPE_MODE (type, smallest_mode_for_size (TYPE_PRECISION (type), MODE_INT)); TYPE_SIZE (type) = bitsize_int (GET_MODE_BITSIZE (TYPE_MODE (type))); @@ -2520,6 +2511,12 @@ set_min_and_max_values_for_integral_type (tree type, tree min_value; tree max_value; + /* For bitfields with zero width we end up creating integer types + with zero precision. Don't assign any minimum/maximum values + to those types, they don't have any valid value. */ + if (precision < 1) + return; + if (is_unsigned) { min_value = build_int_cst (type, 0); |