diff options
author | Richard Henderson <rth@redhat.com> | 2004-12-09 14:55:41 -0800 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2004-12-09 14:55:41 -0800 |
commit | d1838621508795fc4929726c5044f7b6da76b70b (patch) | |
tree | 87730571a2c8621852cfb33bbffd30e0cd8904e5 /gcc/c-common.c | |
parent | 88b3da50a83f81da86e28d0b99886fa8b819ead4 (diff) | |
download | gcc-d1838621508795fc4929726c5044f7b6da76b70b.zip gcc-d1838621508795fc4929726c5044f7b6da76b70b.tar.gz gcc-d1838621508795fc4929726c5044f7b6da76b70b.tar.bz2 |
re PR c/18282 (PR c/17384 patch causes regression from 3.4.2)
PR c/18282
* attribs.c (decl_attributes): Use relayout_decl.
* c-common.c (handle_mode_attribute): Copy all relevant type
parameters from the new underlying integral type.
From-SVN: r91978
Diffstat (limited to 'gcc/c-common.c')
-rw-r--r-- | gcc/c-common.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/gcc/c-common.c b/gcc/c-common.c index fa555a7..d58d326 100644 --- a/gcc/c-common.c +++ b/gcc/c-common.c @@ -4302,7 +4302,17 @@ handle_mode_attribute (tree *node, tree name, tree args, if (!(flags & (int) ATTR_FLAG_TYPE_IN_PLACE)) type = build_variant_type_copy (type); + + /* We cannot use layout_type here, because that will attempt + to re-layout all variants, corrupting our original. */ TYPE_PRECISION (type) = TYPE_PRECISION (typefm); + TYPE_MIN_VALUE (type) = TYPE_MIN_VALUE (typefm); + TYPE_MAX_VALUE (type) = TYPE_MAX_VALUE (typefm); + TYPE_SIZE (type) = TYPE_SIZE (typefm); + TYPE_SIZE_UNIT (type) = TYPE_SIZE_UNIT (typefm); + if (!TYPE_USER_ALIGN (type)) + TYPE_ALIGN (type) = TYPE_ALIGN (typefm); + typefm = type; } else if (VECTOR_MODE_P (mode) @@ -4314,8 +4324,6 @@ handle_mode_attribute (tree *node, tree name, tree args, } *node = typefm; - - /* No need to layout the type here. The caller should do this. */ } return NULL_TREE; |