2004-12-09 Richard Henderson <rth@redhat.com>
+ 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.
+
+2004-12-09 Richard Henderson <rth@redhat.com>
+
* c-common.c (shorten_compare): Don't special-case min/maxval
for C enumerations.
&& (TREE_CODE (*node) == VAR_DECL
|| TREE_CODE (*node) == PARM_DECL
|| TREE_CODE (*node) == RESULT_DECL))
- {
- /* Force a recalculation of mode and size. */
- DECL_MODE (*node) = VOIDmode;
- DECL_SIZE (*node) = 0;
-
- layout_decl (*node, 0);
- }
+ relayout_decl (*node);
if (!no_add_attrs)
{
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)
}
*node = typefm;
-
- /* No need to layout the type here. The caller should do this. */
}
return NULL_TREE;