aboutsummaryrefslogtreecommitdiff
path: root/gcc/f/com.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2000-06-14 07:30:09 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2000-06-14 07:30:09 +0200
commit11cf4d1831071d23c84e1add8a2d3fbdd360a82e (patch)
tree48e491d0a3752df2f9332542b6e3fd795956e7c0 /gcc/f/com.c
parent51d0e20cae600863c06b07134419166632180a80 (diff)
downloadgcc-11cf4d1831071d23c84e1add8a2d3fbdd360a82e.zip
gcc-11cf4d1831071d23c84e1add8a2d3fbdd360a82e.tar.gz
gcc-11cf4d1831071d23c84e1add8a2d3fbdd360a82e.tar.bz2
tree.h (TYPE_USER_ALIGN, [...]): Define.
* tree.h (TYPE_USER_ALIGN, DECL_USER_ALIGN): Define. (struct tree_type, struct tree_decl): Add user_align member. * stor-layout.c (layout_decl): Set DECL_USER_ALIGN. (place_union_field): If BIGGEST_FIELD_ALIGNMENT is defined and DECL_USER_ALIGN 0, cap alignment to this value. (place_field): Likewise. (finalize_type_size): Set TYPE_USER_ALIGN. (layout_type): Likewise. (initialize_sizetypes): Likewise. * c-common.c (decl_attributes): Set TYPE_USER_ALIGN resp. DECL_USER_ALIGN to 1. * c-decl.c (duplicate_decls): Set DECL_USER_ALIGN. (xfer_tag): Set TYPE_USER_ALIGN. (finish_struct): Set DECL_USER_ALIGN resp. TYPE_USER_ALIGN. (finish_enum): Likewise. * stmt.c (expand_decl): Set DECL_USER_ALIGN. (expand_anon_union_decl): Likewise. * tree.c (make_node): Set DECL_USER_ALIGN resp. TYPE_USER_ALIGN. (build_index_type): Set TYPE_USER_ALIGN. (build_range_type): Likewise. (build_common_tree_nodes_2): Likewise. * tm.texi (BIGGEST_FIELD_ALIGNMENT): Document the changed meaning. ch/: * decl.c (init_decl_processing): Set TYPE_USER_ALIGN. (layout_enum): Set DECL_USER_ALIGN resp. TYPE_USER_ALIGN. * typeck.c (layout_chill_range_type): Set TYPE_USER_ALIGN. (apply_chill_field_layout): Set DECL_USER_ALIGN. (layout_chill_struct_type): Set TYPE_USER_ALIGN. cp/: * class.c (build_secondary_vtable): Set DECL_USER_ALIGN. (check_bitfield_decl, check_field_decl): Likewise. (build_vtbl_or_vbase_field, build_base_field): Likewise. (layout_class_type): Set DECL_USER_ALIGN resp. CLASSTYPE_USER_ALIGN. * decl.c (record_unknown_type): Set TYPE_USER_ALIGN. (xfer_tag, finish_enum): Likewise. * decl2.c (finish_builtin_type): Likewise. * init.c (init_init_processing): Likewise. * pt.c (instantiate_class_template): Likewise. * rtti.c (get_tinfo_decl, synthesize_tinfo_fn): Set DECL_USER_ALIGN. * cp-tree.h (struct lang_type): Add user_align member. (CLASSTYPE_USER_ALIGN): Define. f/: * com.c (ffecom_transform_common_): Set DECL_USER_ALIGN. (ffecom_transform_equiv_, ffecom_decl_field): Likewise. (ffecom_init_0): Set DECL_USER_ALIGN resp. TYPE_USER_ALIGN. (duplicate_decls): Set DECL_USER_ALIGN. java/: * typeck.c (build_java_array_type): Set TYPE_USER_ALIGN. * parse.y (java_complete_class): Set DECL_USER_ALIGN. * parse.c: Rebuilt. From-SVN: r34541
Diffstat (limited to 'gcc/f/com.c')
-rw-r--r--gcc/f/com.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/gcc/f/com.c b/gcc/f/com.c
index 7d593fd5..7611d24 100644
--- a/gcc/f/com.c
+++ b/gcc/f/com.c
@@ -8801,6 +8801,7 @@ ffecom_transform_common_ (ffesymbol s)
this seems easy enough. */
DECL_ALIGN (cbt) = BIGGEST_ALIGNMENT;
+ DECL_USER_ALIGN (cbt) = 0;
if (is_init && (ffestorag_init (st) == NULL))
init = ffecom_init_zero_ (cbt);
@@ -8936,6 +8937,7 @@ ffecom_transform_equiv_ (ffestorag eqst)
this seems easy enough. */
DECL_ALIGN (eqt) = BIGGEST_ALIGNMENT;
+ DECL_USER_ALIGN (eqt) = 0;
if ((!is_init && ffe_is_init_local_zero ())
|| (is_init && (ffestorag_init (eqst) == NULL)))
@@ -10999,6 +11001,7 @@ ffecom_decl_field (tree context, tree prevfield,
field = build_decl (FIELD_DECL, get_identifier (name), type);
DECL_CONTEXT (field) = context;
DECL_ALIGN (field) = 0;
+ DECL_USER_ALIGN (field) = 0;
if (prevfield != NULL_TREE)
TREE_CHAIN (prevfield) = field;
@@ -11634,6 +11637,7 @@ ffecom_init_0 ()
/* We are not going to have real types in C with less than byte alignment,
so we might as well not have any types that claim to have it. */
TYPE_ALIGN (void_type_node) = BITS_PER_UNIT;
+ TYPE_USER_ALIGN (void_type_node) = 0;
string_type_node = build_pointer_type (char_type_node);
@@ -12055,6 +12059,7 @@ ffecom_init_0 ()
DECL_CONTEXT (ffecom_multi_fields_[i][j])
= ffecom_multi_type_node_;
DECL_ALIGN (ffecom_multi_fields_[i][j]) = 0;
+ DECL_USER_ALIGN (ffecom_multi_fields_[i][j]) = 0;
TREE_CHAIN (ffecom_multi_fields_[i][j]) = field;
field = ffecom_multi_fields_[i][j];
}
@@ -13783,7 +13788,10 @@ duplicate_decls (tree newdecl, tree olddecl)
DECL_SIZE_UNIT (newdecl) = DECL_SIZE_UNIT (olddecl);
if (TREE_CODE (olddecl) != FUNCTION_DECL)
if (DECL_ALIGN (olddecl) > DECL_ALIGN (newdecl))
- DECL_ALIGN (newdecl) = DECL_ALIGN (olddecl);
+ {
+ DECL_ALIGN (newdecl) = DECL_ALIGN (olddecl);
+ DECL_USER_ALIGN (newdecl) |= DECL_USER_ALIGN (olddecl);
+ }
}
/* Keep the old rtl since we can safely use it. */