From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 81088 invoked by alias); 10 Dec 2015 15:04:16 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 81072 invoked by uid 89); 10 Dec 2015 15:04:15 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.4 required=5.0 tests=AWL,BAYES_50,KAM_ASCII_DIVIDERS,RCVD_IN_DNSWL_LOW,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx2.suse.de Received: from mx2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (CAMELLIA256-SHA encrypted) ESMTPS; Thu, 10 Dec 2015 15:04:08 +0000 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 6EA1EAD73 for ; Thu, 10 Dec 2015 15:04:04 +0000 (UTC) Date: Thu, 10 Dec 2015 15:04:00 -0000 From: Michael Matz To: gcc-patches@gcc.gnu.org Subject: Free up bits in DECLs and TYPEs Message-ID: User-Agent: Alpine 2.20 (LSU 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-IsSubscribed: yes X-SW-Source: 2015-12/txt/msg01143.txt.bz2 Hello, the other day Richi wondered why we specify alignment in bits, instead of in log2, as if e.g. a 12 byte alignment would make much sense (sure, an alignment of 12 byte means the address is evenly dividable by 12; great!). This patch changes the two places where we specify alignment (types and decls) to use the log2 of alignment and accordingly reduces the field-size to 6 bits from 32 bits. This frees up many bits in both structures (26 in tree_type_common and 20 in tree_decl_common (plus in 32bit hole on 64bit archs)), but at this point there's not much possibility to move around some other members to really reduce the overall structure sizes (we could move address_space from tree_base to type_common now, but that doesn't reduce tree_base, except for giving _it_ eight more bits, but that's not necessary right now). Unfortunately we need to support an alignment of up to MAX_OFILE_ALIGNMENT, which on ELF is 8<<28, even though I think this is fairly silly, so we need 6 bits, instead of 4 or 5 (which would support up to page or large-page alignment). While being at it I reduce also the other alignment specifier (off_align for field_decls) to that number of bits. The core of the patch is trivial: tree-core.h for the structure change and tree.h for accessor macros. As TYPE_ALIGN and DECL_ALIGN can't be lvalues anymore we need a SET_{DECL,TYPE}_ALIGN accessor as well, and that's the cause of the patches size: we need to change all write accesses everywhere. I've changed all places I could find via building and greping. The patch was regstrapped on x86_64-linux (all languages) without regressions. This isn't stage 3 material really, OTOH fairly low risk. Anyway, okay for trunk now or once stage 1 opens? Ciao, Michael. * tree.h (TYPE_ALIGN, DECL_ALIGN): Return shifted amount. (SET_TYPE_ALIGN, SET_DECL_ALIGN): New. * tree-core.h (tree_type_common.align): Use bit-field. (tree_type_common.spare): New. (tree_decl_common.off_align): Make smaller. (tree_decl_common.align): Use bit-field. * expr.c (expand_expr_addr_expr_1): Use SET_TYPE_ALIGN. * omp-low.c (install_var_field): Use SET_DECL_ALIGN. (scan_sharing_clauses): Ditto. (finish_taskreg_scan): Use SET_DECL_ALIGN and SET_TYPE_ALIGN. (omp_finish_file): Ditto. * stor-layout.c (do_type_align): Use SET_DECL_ALIGN. (layout_decl): Ditto. (relayout_decl): Ditto. (finalize_record_size): Use SET_TYPE_ALIGN. (finalize_type_size): Ditto. (finish_builtin_struct): Ditto. (layout_type): Ditto. (initialize_sizetypes): Ditto. * targhooks.c (std_gimplify_va_arg_expr): Use SET_TYPE_ALIGN. * tree-nested.c (insert_field_into_struct): Use SET_TYPE_ALIGN. (lookup_field_for_decl): Use SET_DECL_ALIGN. (get_chain_field): Ditto. (get_trampoline_type): Ditto. (get_nl_goto_field): Ditto. * tree-streamer-in.c (unpack_ts_decl_common_value_fields): Use SET_DECL_ALIGN. (unpack_ts_type_common_value_fields): Use SET_TYPE_ALIGN. * tree.c (make_node_stat): Use SET_DECL_ALIGN and SET_TYPE_ALIGN. (build_qualified_type): Use SET_TYPE_ALIGN. (build_aligned_type, build_range_type_1): Ditto. (build_atomic_base): Ditto. (build_common_tree_nodes): Ditto. * cfgexpand.c (align_local_variable): Use SET_DECL_ALIGN. (expand_one_stack_var_at): Ditto. * coverage.c (build_var): Use SET_DECL_ALIGN. * except.c (init_eh): Ditto. * function.c (assign_parm_setup_block): Ditto. * symtab.c (increase_alignment_1): Ditto. * tree-ssa-ccp.c (fold_builtin_alloca_with_align): Ditto. * tree-vect-stmts.c (ensure_base_align): Ditto. * varasm.c (align_variable): Ditto. (assemble_variable): Ditto. (build_constant_desc): Ditto. (output_constant_def_contents): Ditto. * config/arm/arm.c (arm_relayout_function): Use SET_DECL_ALIGN. * config/avr/avr.c (avr_adjust_type_node): Use SET_TYPE_ALIGN. * config/mips/mips.c (mips_std_gimplify_va_arg_expr): Ditto. * config/msp430/msp430.c (msp430_gimplify_va_arg_expr): Ditto. * config/spu/spu.c (spu_build_builtin_va_list): Use SET_DECL_ALIGN. ada/ * gcc-interface/decl.c (gnat_to_gnu_entity): Use SET_TYPE_ALIGN. (gnat_to_gnu_field): Ditto. (components_to_record): Ditto. (create_variant_part_from): Ditto. (copy_and_substitute_in_size): Ditto. (substitute_in_type): Ditto. * gcc-interface/utils.c (make_aligning_type): Use SET_TYPE_ALIGN. (make_packable_type): Ditto. (maybe_pad_type): Ditto. (finish_fat_pointer_type): Ditto. (finish_record_type): Ditto and use SET_DECL_ALIGN. (rest_of_record_type_compilation): Use SET_TYPE_ALIGN. (create_field_decl): Use SET_DECL_ALIGN. c-family/ * c-common.c (handle_aligned_attribute): Use SET_TYPE_ALIGN and SET_DECL_ALIGN. c/ * c-decl.c (merge_decls): Use SET_DECL_ALIGN. (grokdeclarator, parser_xref_tag, finish_enum): Use SET_TYPE_ALIGN. cp/ * class.c (build_vtable): Use SET_DECL_ALIGN and SET_TYPE_ALIGN. (layout_class_type): Ditto. (build_base_field): Use SET_DECL_ALIGN. * decl.c (duplicate_decls): Use SET_DECL_ALIGN. (record_unknown_type): Use SET_TYPE_ALIGN. (cxx_init_decl_processing): Ditto. (grokfndecl): Use SET_DECL_ALIGN. (copy_type_enum): Use SET_TYPE_ALIGN. * pt.c (instantiate_class_template_1): Use SET_TYPE_ALIGN. (tsubst): Ditto. * tree.c (cp_build_qualified_type_real): Use SET_TYPE_ALIGN. * lambda.c (maybe_add_lambda_conv_op): Use SET_DECL_ALIGN. * method.c (implicitly_declare_fn): Use SET_DECL_ALIGN. * rtti.c (emit_tinfo_decl): Ditto. fortran/ * trans-io.c (gfc_build_io_library_fndecls): Use SET_TYPE_ALIGN. * trans-common.c (build_common_decl): Use SET_DECL_ALIGN. * trans-types.c (gfc_add_field_to_struct): Use SET_DECL_ALIGN. go/ * go-gcc.cc (Gcc_backend::implicit_variable): Use SET_DECL_ALIGN. java/ * class.c (add_method_1): Use SET_DECL_ALIGN. (make_class_data): Ditto. (emit_register_classes_in_jcr_section): Ditto. * typeck.c (build_java_array_type): Ditto. objc/ * objc-act.c (objc_build_struct): Use SET_DECL_ALIGN. libcc1/ * plugin.cc (plugin_finish_record_or_union): Use SET_TYPE_ALIGN. Index: gcc/tree.h =================================================================== --- gcc.orig/tree.h 2015-12-07 21:37:28.000000000 +0100 +++ gcc/tree.h 2015-12-09 14:37:40.000000000 +0100 @@ -916,10 +916,7 @@ extern void omp_clause_range_check_faile of this type is aligned at least to the alignment of the type, even if it doesn't appear that it is. We see this, for example, in object-oriented languages where a tag field may show this is an object of a more-aligned - variant of the more generic type. - - In an SSA_NAME node, nonzero if the SSA_NAME node is on the SSA_NAME - freelist. */ + variant of the more generic type. */ #define TYPE_ALIGN_OK(NODE) (TYPE_CHECK (NODE)->base.nothrow_flag) /* Used in classes in C++. */ @@ -1849,8 +1846,16 @@ extern machine_mode element_mode (const_ #define TYPE_ATTRIBUTES(NODE) (TYPE_CHECK (NODE)->type_common.attributes) /* The alignment necessary for objects of this type. - The value is an int, measured in bits. */ -#define TYPE_ALIGN(NODE) (TYPE_CHECK (NODE)->type_common.align) + The value is an int, measured in bits and must be a power of two. + We support also an "alignement" of zero. */ +#define TYPE_ALIGN(NODE) \ + (TYPE_CHECK (NODE)->type_common.align \ + ? ((unsigned)1) << ((NODE)->type_common.align - 1) \ + : 0) + +/* Specify that TYPE_ALIGN(NODE) is X. */ +#define SET_TYPE_ALIGN(NODE, X) \ + (TYPE_CHECK (NODE)->type_common.align = ffs_hwi (X)) /* 1 if the alignment for this type was requested by "aligned" attribute, 0 if it is the default for this type. */ @@ -2290,8 +2295,17 @@ extern machine_mode element_mode (const_ #define DECL_SIZE(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.size) /* Likewise for the size in bytes. */ #define DECL_SIZE_UNIT(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.size_unit) -/* Holds the alignment required for the datum, in bits. */ -#define DECL_ALIGN(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.align) +/* Returns the alignment required for the datum, in bits. It must + be a power of two, but an "alignment" of zero is supported + (e.g. as "uninitialized" sentinel). */ +#define DECL_ALIGN(NODE) \ + (DECL_COMMON_CHECK (NODE)->decl_common.align \ + ? ((unsigned)1) << ((NODE)->decl_common.align - 1) \ + : 0) +/* Specify that DECL_ALIGN(NODE) is X. */ +#define SET_DECL_ALIGN(NODE, X) \ + (DECL_COMMON_CHECK (NODE)->decl_common.align = ffs_hwi (X)) + /* The alignment of NODE, in bytes. */ #define DECL_ALIGN_UNIT(NODE) (DECL_ALIGN (NODE) / BITS_PER_UNIT) /* Set if the alignment of this DECL has been set by the user, for @@ -2494,7 +2508,7 @@ extern void decl_value_expr_insert (tree #define DECL_OFFSET_ALIGN(NODE) \ (((unsigned HOST_WIDE_INT)1) << FIELD_DECL_CHECK (NODE)->decl_common.off_align) -/* Specify that DECL_ALIGN(NODE) is a multiple of X. */ +/* Specify that DECL_OFFSET_ALIGN(NODE) is X. */ #define SET_DECL_OFFSET_ALIGN(NODE, X) \ (FIELD_DECL_CHECK (NODE)->decl_common.off_align = ffs_hwi (X) - 1) Index: gcc/tree-core.h =================================================================== --- gcc.orig/tree-core.h 2015-12-09 18:36:49.000000000 +0100 +++ gcc/tree-core.h 2015-12-10 14:29:16.000000000 +0100 @@ -1436,7 +1436,13 @@ struct GTY(()) tree_type_common { unsigned lang_flag_5 : 1; unsigned lang_flag_6 : 1; - unsigned int align; + /* TYPE_ALIGN in log2; this has to be large enough to hold values + of the maximum of BIGGEST_ALIGNMENT and MAX_OFILE_ALIGNMENT, + the latter being usually the larger. For ELF it is 8<<28, + so we need to store the value 32 (not 31, as we need the zero + as well), hence six bits. */ + unsigned align : 6; + unsigned spare : 26; alias_set_type alias_set; tree pointer_to; tree reference_to; @@ -1537,12 +1543,12 @@ struct GTY(()) tree_decl_common { unsigned decl_nonshareable_flag : 1; /* DECL_OFFSET_ALIGN, used only for FIELD_DECLs. */ - unsigned int off_align : 8; - - /* 24 bits unused. */ + unsigned int off_align : 6; /* DECL_ALIGN. It should have the same size as TYPE_ALIGN. */ - unsigned int align; + unsigned int align : 6; + + /* 20 bits unused. */ /* UID for points-to sets, stable over copying from inlining. */ unsigned int pt_uid; Index: gcc/c-family/c-common.c =================================================================== --- gcc.orig/c-family/c-common.c 2015-12-01 16:09:46.000000000 +0100 +++ gcc/c-family/c-common.c 2015-12-08 17:27:45.000000000 +0100 @@ -8372,7 +8372,7 @@ handle_aligned_attribute (tree *node, tr else *type = build_variant_type_copy (*type); - TYPE_ALIGN (*type) = (1U << i) * BITS_PER_UNIT; + SET_TYPE_ALIGN (*type, (1U << i) * BITS_PER_UNIT); TYPE_USER_ALIGN (*type) = 1; } else if (! VAR_OR_FUNCTION_DECL_P (decl) @@ -8406,7 +8406,7 @@ handle_aligned_attribute (tree *node, tr } else { - DECL_ALIGN (decl) = (1U << i) * BITS_PER_UNIT; + SET_DECL_ALIGN (decl, (1U << i) * BITS_PER_UNIT); DECL_USER_ALIGN (decl) = 1; } Index: gcc/c/c-decl.c =================================================================== --- gcc.orig/c/c-decl.c 2015-12-01 16:09:47.000000000 +0100 +++ gcc/c/c-decl.c 2015-12-08 17:26:06.000000000 +0100 @@ -2381,7 +2381,7 @@ merge_decls (tree newdecl, tree olddecl, DECL_MODE (newdecl) = DECL_MODE (olddecl); if (DECL_ALIGN (olddecl) > DECL_ALIGN (newdecl)) { - DECL_ALIGN (newdecl) = DECL_ALIGN (olddecl); + SET_DECL_ALIGN (newdecl, DECL_ALIGN (olddecl)); DECL_USER_ALIGN (newdecl) |= DECL_USER_ALIGN (olddecl); } } @@ -6693,7 +6693,7 @@ grokdeclarator (const struct c_declarato /* Apply _Alignas specifiers. */ if (alignas_align) { - DECL_ALIGN (decl) = alignas_align * BITS_PER_UNIT; + SET_DECL_ALIGN (decl, alignas_align * BITS_PER_UNIT); DECL_USER_ALIGN (decl) = 1; } @@ -7131,7 +7131,7 @@ parser_xref_tag (location_t loc, enum tr /* Give the type a default layout like unsigned int to avoid crashing if it does not get defined. */ SET_TYPE_MODE (ref, TYPE_MODE (unsigned_type_node)); - TYPE_ALIGN (ref) = TYPE_ALIGN (unsigned_type_node); + SET_TYPE_ALIGN (ref, TYPE_ALIGN (unsigned_type_node)); TYPE_USER_ALIGN (ref) = 0; TYPE_UNSIGNED (ref) = 1; TYPE_PRECISION (ref) = TYPE_PRECISION (unsigned_type_node); @@ -8011,7 +8011,7 @@ finish_enum (tree enumtype, tree values, TYPE_MIN_VALUE (enumtype) = TYPE_MIN_VALUE (tem); TYPE_MAX_VALUE (enumtype) = TYPE_MAX_VALUE (tem); TYPE_UNSIGNED (enumtype) = TYPE_UNSIGNED (tem); - TYPE_ALIGN (enumtype) = TYPE_ALIGN (tem); + SET_TYPE_ALIGN (enumtype, TYPE_ALIGN (tem)); TYPE_SIZE (enumtype) = 0; /* If the precision of the type was specified with an attribute and it @@ -8083,7 +8083,7 @@ finish_enum (tree enumtype, tree values, TYPE_SIZE_UNIT (tem) = TYPE_SIZE_UNIT (enumtype); SET_TYPE_MODE (tem, TYPE_MODE (enumtype)); TYPE_PRECISION (tem) = TYPE_PRECISION (enumtype); - TYPE_ALIGN (tem) = TYPE_ALIGN (enumtype); + SET_TYPE_ALIGN (tem, TYPE_ALIGN (enumtype)); TYPE_USER_ALIGN (tem) = TYPE_USER_ALIGN (enumtype); TYPE_UNSIGNED (tem) = TYPE_UNSIGNED (enumtype); TYPE_LANG_SPECIFIC (tem) = TYPE_LANG_SPECIFIC (enumtype); Index: gcc/config/avr/avr.c =================================================================== --- gcc.orig/config/avr/avr.c 2015-12-01 16:10:15.000000000 +0100 +++ gcc/config/avr/avr.c 2015-12-08 16:45:33.000000000 +0100 @@ -901,7 +901,7 @@ avr_adjust_type_node (tree *node, machin TYPE_IBIT (*node) = GET_MODE_IBIT (mode); TYPE_FBIT (*node) = GET_MODE_FBIT (mode); TYPE_PRECISION (*node) = GET_MODE_BITSIZE (mode); - TYPE_ALIGN (*node) = 8; + SET_TYPE_ALIGN (*node, 8); SET_TYPE_MODE (*node, mode); layout_type (*node); Index: gcc/config/mips/mips.c =================================================================== --- gcc.orig/config/mips/mips.c 2015-12-01 16:10:19.000000000 +0100 +++ gcc/config/mips/mips.c 2015-12-08 16:46:05.000000000 +0100 @@ -6304,7 +6304,7 @@ mips_std_gimplify_va_arg_expr (tree vali if (boundary < TYPE_ALIGN (type)) { type = build_variant_type_copy (type); - TYPE_ALIGN (type) = boundary; + SET_TYPE_ALIGN (type, boundary); } /* Compute the rounded size of the type. */ Index: gcc/config/msp430/msp430.c =================================================================== --- gcc.orig/config/msp430/msp430.c 2015-12-01 16:10:19.000000000 +0100 +++ gcc/config/msp430/msp430.c 2015-12-08 16:46:37.000000000 +0100 @@ -1379,7 +1379,7 @@ msp430_gimplify_va_arg_expr (tree valist if (boundary < TYPE_ALIGN (type)) { type = build_variant_type_copy (type); - TYPE_ALIGN (type) = boundary; + SET_TYPE_ALIGN (type, boundary); } /* Compute the rounded size of the type. */ Index: gcc/cp/class.c =================================================================== --- gcc.orig/cp/class.c 2015-12-01 16:09:51.000000000 +0100 +++ gcc/cp/class.c 2015-12-08 17:27:31.000000000 +0100 @@ -775,7 +775,7 @@ build_vtable (tree class_type, tree name TREE_STATIC (decl) = 1; TREE_READONLY (decl) = 1; DECL_VIRTUAL_P (decl) = 1; - DECL_ALIGN (decl) = TARGET_VTABLE_ENTRY_ALIGN; + SET_DECL_ALIGN (decl, TARGET_VTABLE_ENTRY_ALIGN); DECL_USER_ALIGN (decl) = true; DECL_VTABLE_OR_VTT_P (decl) = 1; set_linkage_according_to_type (class_type, decl); @@ -1981,7 +1981,7 @@ fixup_attribute_variants (tree t) valign = MAX (valign, TYPE_ALIGN (variants)); else TYPE_USER_ALIGN (variants) = user_align; - TYPE_ALIGN (variants) = valign; + SET_TYPE_ALIGN (variants, valign); } } @@ -4426,7 +4426,7 @@ build_base_field (record_layout_info rli { DECL_SIZE (decl) = CLASSTYPE_SIZE (basetype); DECL_SIZE_UNIT (decl) = CLASSTYPE_SIZE_UNIT (basetype); - DECL_ALIGN (decl) = CLASSTYPE_ALIGN (basetype); + SET_DECL_ALIGN (decl, CLASSTYPE_ALIGN (basetype)); DECL_USER_ALIGN (decl) = CLASSTYPE_USER_ALIGN (basetype); DECL_MODE (decl) = TYPE_MODE (basetype); DECL_FIELD_IS_BASE (decl) = 1; @@ -6331,7 +6331,7 @@ layout_class_type (tree t, tree *virtual } DECL_SIZE (field) = TYPE_SIZE (integer_type); - DECL_ALIGN (field) = TYPE_ALIGN (integer_type); + SET_DECL_ALIGN (field, TYPE_ALIGN (integer_type)); DECL_USER_ALIGN (field) = TYPE_USER_ALIGN (integer_type); layout_nonempty_base_or_field (rli, field, NULL_TREE, empty_base_offsets); @@ -6466,7 +6466,7 @@ layout_class_type (tree t, tree *virtual size_binop (MULT_EXPR, fold_convert (bitsizetype, eoc), bitsize_int (BITS_PER_UNIT))); - TYPE_ALIGN (base_t) = rli->record_align; + SET_TYPE_ALIGN (base_t, rli->record_align); TYPE_USER_ALIGN (base_t) = TYPE_USER_ALIGN (t); /* Copy the fields from T. */ Index: gcc/cp/decl.c =================================================================== --- gcc.orig/cp/decl.c 2015-12-01 16:09:51.000000000 +0100 +++ gcc/cp/decl.c 2015-12-08 17:26:41.000000000 +0100 @@ -2437,7 +2437,7 @@ duplicate_decls (tree newdecl, tree oldd /* Likewise for DECL_ALIGN, DECL_USER_ALIGN and DECL_PACKED. */ if (DECL_ALIGN (olddecl) > DECL_ALIGN (newdecl)) { - DECL_ALIGN (newdecl) = DECL_ALIGN (olddecl); + SET_DECL_ALIGN (newdecl, DECL_ALIGN (olddecl)); DECL_USER_ALIGN (newdecl) |= DECL_USER_ALIGN (olddecl); } DECL_USER_ALIGN (olddecl) = DECL_USER_ALIGN (newdecl); @@ -3866,7 +3866,7 @@ record_unknown_type (tree type, const ch DECL_IGNORED_P (decl) = 1; TYPE_DECL_SUPPRESS_DEBUG (decl) = 1; TYPE_SIZE (type) = TYPE_SIZE (void_type_node); - TYPE_ALIGN (type) = 1; + SET_TYPE_ALIGN (type, 1); TYPE_USER_ALIGN (type) = 0; SET_TYPE_MODE (type, TYPE_MODE (void_type_node)); } @@ -4121,7 +4121,7 @@ cxx_init_decl_processing (void) TYPE_UNSIGNED (nullptr_type_node) = 1; TYPE_PRECISION (nullptr_type_node) = GET_MODE_BITSIZE (ptr_mode); if (abi_version_at_least (9)) - TYPE_ALIGN (nullptr_type_node) = GET_MODE_ALIGNMENT (ptr_mode); + SET_TYPE_ALIGN (nullptr_type_node, GET_MODE_ALIGNMENT (ptr_mode)); SET_TYPE_MODE (nullptr_type_node, ptr_mode); record_builtin_type (RID_MAX, "decltype(nullptr)", nullptr_type_node); nullptr_node = build_int_cst (nullptr_type_node, 0); @@ -7849,7 +7849,7 @@ grokfndecl (tree ctype, parms = parm; /* Allocate space to hold the vptr bit if needed. */ - DECL_ALIGN (decl) = MINIMUM_METHOD_BOUNDARY; + SET_DECL_ALIGN (decl, MINIMUM_METHOD_BOUNDARY); } DECL_ARGUMENTS (decl) = parms; for (t = parms; t; t = DECL_CHAIN (t)) @@ -12996,7 +12996,7 @@ copy_type_enum (tree dst, tree src) TYPE_SIZE_UNIT (t) = TYPE_SIZE_UNIT (src); SET_TYPE_MODE (dst, TYPE_MODE (src)); TYPE_PRECISION (t) = TYPE_PRECISION (src); - TYPE_ALIGN (t) = TYPE_ALIGN (src); + SET_TYPE_ALIGN (t, TYPE_ALIGN (src)); TYPE_USER_ALIGN (t) = TYPE_USER_ALIGN (src); TYPE_UNSIGNED (t) = TYPE_UNSIGNED (src); } Index: gcc/cp/pt.c =================================================================== --- gcc.orig/cp/pt.c 2015-12-08 16:09:08.000000000 +0100 +++ gcc/cp/pt.c 2015-12-08 16:44:01.000000000 +0100 @@ -9760,7 +9760,7 @@ instantiate_class_template_1 (tree type) DECL_SOURCE_LOCATION (typedecl); TYPE_PACKED (type) = TYPE_PACKED (pattern); - TYPE_ALIGN (type) = TYPE_ALIGN (pattern); + SET_TYPE_ALIGN (type, TYPE_ALIGN (pattern)); TYPE_USER_ALIGN (type) = TYPE_USER_ALIGN (pattern); TYPE_FOR_JAVA (type) = TYPE_FOR_JAVA (pattern); /* For libjava's JArray */ if (ANON_AGGR_TYPE_P (pattern)) @@ -13254,7 +13254,7 @@ tsubst (tree t, tree args, tsubst_flags_ if (TYPE_USER_ALIGN (t)) { - TYPE_ALIGN (r) = TYPE_ALIGN (t); + SET_TYPE_ALIGN (r, TYPE_ALIGN (t)); TYPE_USER_ALIGN (r) = 1; } Index: gcc/cp/tree.c =================================================================== --- gcc.orig/cp/tree.c 2015-12-01 16:09:51.000000000 +0100 +++ gcc/cp/tree.c 2015-12-08 16:44:28.000000000 +0100 @@ -1067,7 +1067,7 @@ cp_build_qualified_type_real (tree type, { t = build_variant_type_copy (t); TYPE_NAME (t) = TYPE_NAME (type); - TYPE_ALIGN (t) = TYPE_ALIGN (type); + SET_TYPE_ALIGN (t, TYPE_ALIGN (type)); TYPE_USER_ALIGN (t) = TYPE_USER_ALIGN (type); } } Index: gcc/expr.c =================================================================== --- gcc.orig/expr.c 2015-12-01 16:09:53.000000000 +0100 +++ gcc/expr.c 2015-12-08 16:29:00.000000000 +0100 @@ -7699,7 +7699,7 @@ expand_expr_addr_expr_1 (tree exp, rtx t { inner = copy_node (inner); TREE_TYPE (inner) = copy_node (TREE_TYPE (inner)); - TYPE_ALIGN (TREE_TYPE (inner)) = TYPE_ALIGN (TREE_TYPE (exp)); + SET_TYPE_ALIGN (TREE_TYPE (inner), TYPE_ALIGN (TREE_TYPE (exp))); TYPE_USER_ALIGN (TREE_TYPE (inner)) = 1; } result = expand_expr_addr_expr_1 (inner, subtarget, tmode, modifier, as); Index: gcc/fortran/trans-io.c =================================================================== --- gcc.orig/fortran/trans-io.c 2015-12-01 16:10:08.000000000 +0100 +++ gcc/fortran/trans-io.c 2015-12-08 16:45:00.000000000 +0100 @@ -309,8 +309,8 @@ gfc_build_io_library_fndecls (void) alignment that is at least as large as the needed alignment for those types. See the st_parameter_dt structure in libgfortran/io/io.h for what really goes into this space. */ - TYPE_ALIGN (types[IOPARM_type_pad]) = MAX (TYPE_ALIGN (pchar_type_node), - TYPE_ALIGN (gfc_get_int_type (gfc_intio_kind))); + SET_TYPE_ALIGN (types[IOPARM_type_pad], MAX (TYPE_ALIGN (pchar_type_node), + TYPE_ALIGN (gfc_get_int_type (gfc_intio_kind)))); for (ptype = IOPARM_ptype_common; ptype < IOPARM_ptype_num; ptype++) gfc_build_st_parameter ((enum ioparam_type) ptype, types); Index: gcc/omp-low.c =================================================================== --- gcc.orig/omp-low.c 2015-12-01 16:09:49.000000000 +0100 +++ gcc/omp-low.c 2015-12-08 17:14:34.000000000 +0100 @@ -1406,12 +1406,12 @@ install_var_field (tree var, bool by_ref DECL_ABSTRACT_ORIGIN (field) = var; if (type == TREE_TYPE (var)) { - DECL_ALIGN (field) = DECL_ALIGN (var); + SET_DECL_ALIGN (field, DECL_ALIGN (var)); DECL_USER_ALIGN (field) = DECL_USER_ALIGN (var); TREE_THIS_VOLATILE (field) = TREE_THIS_VOLATILE (var); } else - DECL_ALIGN (field) = TYPE_ALIGN (type); + SET_DECL_ALIGN (field, TYPE_ALIGN (type)); if ((mask & 3) == 3) { @@ -1421,7 +1421,7 @@ install_var_field (tree var, bool by_ref sfield = build_decl (DECL_SOURCE_LOCATION (var), FIELD_DECL, DECL_NAME (var), type); DECL_ABSTRACT_ORIGIN (sfield) = var; - DECL_ALIGN (sfield) = DECL_ALIGN (field); + SET_DECL_ALIGN (sfield, DECL_ALIGN (field)); DECL_USER_ALIGN (sfield) = DECL_USER_ALIGN (field); TREE_THIS_VOLATILE (sfield) = TREE_THIS_VOLATILE (field); insert_field_into_struct (ctx->srecord_type, sfield); @@ -2105,7 +2105,7 @@ scan_sharing_clauses (tree clauses, omp_ tree field = build_decl (OMP_CLAUSE_LOCATION (c), FIELD_DECL, NULL_TREE, ptr_type_node); - DECL_ALIGN (field) = TYPE_ALIGN (ptr_type_node); + SET_DECL_ALIGN (field, TYPE_ALIGN (ptr_type_node)); insert_field_into_struct (ctx->record_type, field); splay_tree_insert (ctx->field_map, (splay_tree_key) decl, (splay_tree_value) field); @@ -2744,18 +2744,18 @@ finish_taskreg_scan (omp_context *ctx) TREE_TYPE (field) = build_pointer_type (TREE_TYPE (decl)); TREE_THIS_VOLATILE (field) = 0; DECL_USER_ALIGN (field) = 0; - DECL_ALIGN (field) = TYPE_ALIGN (TREE_TYPE (field)); + SET_DECL_ALIGN (field, TYPE_ALIGN (TREE_TYPE (field))); if (TYPE_ALIGN (ctx->record_type) < DECL_ALIGN (field)) - TYPE_ALIGN (ctx->record_type) = DECL_ALIGN (field); + SET_TYPE_ALIGN (ctx->record_type, DECL_ALIGN (field)); if (ctx->srecord_type) { tree sfield = lookup_sfield (decl, ctx); TREE_TYPE (sfield) = TREE_TYPE (field); TREE_THIS_VOLATILE (sfield) = 0; DECL_USER_ALIGN (sfield) = 0; - DECL_ALIGN (sfield) = DECL_ALIGN (field); + SET_DECL_ALIGN (sfield, DECL_ALIGN (field)); if (TYPE_ALIGN (ctx->srecord_type) < DECL_ALIGN (sfield)) - TYPE_ALIGN (ctx->srecord_type) = DECL_ALIGN (sfield); + SET_TYPE_ALIGN (ctx->srecord_type, DECL_ALIGN (sfield)); } } } @@ -18520,8 +18520,8 @@ omp_finish_file (void) num_vars * 2); tree funcs_decl_type = build_array_type_nelts (pointer_sized_int_node, num_funcs); - TYPE_ALIGN (vars_decl_type) = TYPE_ALIGN (pointer_sized_int_node); - TYPE_ALIGN (funcs_decl_type) = TYPE_ALIGN (pointer_sized_int_node); + SET_TYPE_ALIGN (vars_decl_type, TYPE_ALIGN (pointer_sized_int_node)); + SET_TYPE_ALIGN (funcs_decl_type, TYPE_ALIGN (pointer_sized_int_node)); tree ctor_v = build_constructor (vars_decl_type, v_v); tree ctor_f = build_constructor (funcs_decl_type, v_f); TREE_CONSTANT (ctor_v) = TREE_CONSTANT (ctor_f) = 1; @@ -18537,8 +18537,8 @@ omp_finish_file (void) otherwise a joint table in a binary will contain padding between tables from multiple object files. */ DECL_USER_ALIGN (funcs_decl) = DECL_USER_ALIGN (vars_decl) = 1; - DECL_ALIGN (funcs_decl) = TYPE_ALIGN (funcs_decl_type); - DECL_ALIGN (vars_decl) = TYPE_ALIGN (vars_decl_type); + SET_DECL_ALIGN (funcs_decl, TYPE_ALIGN (funcs_decl_type)); + SET_DECL_ALIGN (vars_decl, TYPE_ALIGN (vars_decl_type)); DECL_INITIAL (funcs_decl) = ctor_f; DECL_INITIAL (vars_decl) = ctor_v; set_decl_section_name (funcs_decl, OFFLOAD_FUNC_TABLE_SECTION_NAME); Index: gcc/stor-layout.c =================================================================== --- gcc.orig/stor-layout.c 2015-12-01 16:10:11.000000000 +0100 +++ gcc/stor-layout.c 2015-12-08 17:17:18.000000000 +0100 @@ -574,7 +574,7 @@ do_type_align (tree type, tree decl) { if (TYPE_ALIGN (type) > DECL_ALIGN (decl)) { - DECL_ALIGN (decl) = TYPE_ALIGN (type); + SET_DECL_ALIGN (decl, TYPE_ALIGN (type)); if (TREE_CODE (decl) == FIELD_DECL) DECL_USER_ALIGN (decl) = TYPE_USER_ALIGN (type); } @@ -667,7 +667,7 @@ layout_decl (tree decl, unsigned int kno #ifdef EMPTY_FIELD_BOUNDARY if (EMPTY_FIELD_BOUNDARY > DECL_ALIGN (decl)) { - DECL_ALIGN (decl) = EMPTY_FIELD_BOUNDARY; + SET_DECL_ALIGN (decl, EMPTY_FIELD_BOUNDARY); DECL_USER_ALIGN (decl) = 0; } #endif @@ -689,7 +689,7 @@ layout_decl (tree decl, unsigned int kno && !(xalign > BITS_PER_UNIT && DECL_PACKED (decl)) && (known_align == 0 || known_align >= xalign)) { - DECL_ALIGN (decl) = MAX (xalign, DECL_ALIGN (decl)); + SET_DECL_ALIGN (decl, MAX (xalign, DECL_ALIGN (decl))); DECL_MODE (decl) = xmode; DECL_BIT_FIELD (decl) = 0; } @@ -714,7 +714,7 @@ layout_decl (tree decl, unsigned int kno DECL_USER_ALIGN, so we need to check old_user_align instead. */ if (packed_p && !old_user_align) - DECL_ALIGN (decl) = MIN (DECL_ALIGN (decl), BITS_PER_UNIT); + SET_DECL_ALIGN (decl, MIN (DECL_ALIGN (decl), BITS_PER_UNIT)); if (! packed_p && ! DECL_USER_ALIGN (decl)) { @@ -722,11 +722,11 @@ layout_decl (tree decl, unsigned int kno to a lower boundary than alignment of variables unless it was overridden by attribute aligned. */ #ifdef BIGGEST_FIELD_ALIGNMENT - DECL_ALIGN (decl) - = MIN (DECL_ALIGN (decl), (unsigned) BIGGEST_FIELD_ALIGNMENT); + SET_DECL_ALIGN (decl, + MIN (DECL_ALIGN (decl), (unsigned) BIGGEST_FIELD_ALIGNMENT)); #endif #ifdef ADJUST_FIELD_ALIGN - DECL_ALIGN (decl) = ADJUST_FIELD_ALIGN (decl, DECL_ALIGN (decl)); + SET_DECL_ALIGN (decl, ADJUST_FIELD_ALIGN (decl, DECL_ALIGN (decl))); #endif } @@ -736,7 +736,7 @@ layout_decl (tree decl, unsigned int kno mfa = maximum_field_alignment; /* Should this be controlled by DECL_USER_ALIGN, too? */ if (mfa != 0) - DECL_ALIGN (decl) = MIN (DECL_ALIGN (decl), mfa); + SET_DECL_ALIGN (decl, MIN (DECL_ALIGN (decl), mfa)); } /* Evaluate nonconstant size only once, either now or as soon as safe. */ @@ -786,7 +786,7 @@ relayout_decl (tree decl) DECL_SIZE (decl) = DECL_SIZE_UNIT (decl) = 0; DECL_MODE (decl) = VOIDmode; if (!DECL_USER_ALIGN (decl)) - DECL_ALIGN (decl) = 0; + SET_DECL_ALIGN (decl, 0); SET_DECL_RTL (decl, 0); layout_decl (decl, 0); @@ -1567,10 +1567,10 @@ finalize_record_size (record_layout_info /* Determine the desired alignment. */ #ifdef ROUND_TYPE_ALIGN - TYPE_ALIGN (rli->t) = ROUND_TYPE_ALIGN (rli->t, TYPE_ALIGN (rli->t), - rli->record_align); + SET_TYPE_ALIGN (rli->t, ROUND_TYPE_ALIGN (rli->t, TYPE_ALIGN (rli->t), + rli->record_align)); #else - TYPE_ALIGN (rli->t) = MAX (TYPE_ALIGN (rli->t), rli->record_align); + SET_TYPE_ALIGN (rli->t, MAX (TYPE_ALIGN (rli->t), rli->record_align)); #endif /* Compute the size so far. Be sure to allow for extra bits in the @@ -1727,15 +1727,15 @@ finalize_type_size (tree type) alignment of one of the fields. */ if (mode_align >= TYPE_ALIGN (type)) { - TYPE_ALIGN (type) = mode_align; + SET_TYPE_ALIGN (type, mode_align); TYPE_USER_ALIGN (type) = 0; } } /* Do machine-dependent extra alignment. */ #ifdef ROUND_TYPE_ALIGN - TYPE_ALIGN (type) - = ROUND_TYPE_ALIGN (type, TYPE_ALIGN (type), BITS_PER_UNIT); + SET_TYPE_ALIGN (type, + ROUND_TYPE_ALIGN (type, TYPE_ALIGN (type), BITS_PER_UNIT)); #endif /* If we failed to find a simple way to calculate the unit size @@ -1788,7 +1788,7 @@ finalize_type_size (tree type) valign = MAX (valign, TYPE_ALIGN (variant)); else TYPE_USER_ALIGN (variant) = user_align; - TYPE_ALIGN (variant) = valign; + SET_TYPE_ALIGN (variant, valign); TYPE_PRECISION (variant) = precision; SET_TYPE_MODE (variant, mode); } @@ -2082,7 +2082,7 @@ finish_builtin_struct (tree type, const if (align_type) { - TYPE_ALIGN (type) = TYPE_ALIGN (align_type); + SET_TYPE_ALIGN (type, TYPE_ALIGN (align_type)); TYPE_USER_ALIGN (type) = TYPE_USER_ALIGN (align_type); } @@ -2195,7 +2195,7 @@ layout_type (tree type) Instead, query a target hook, defaulting to natural alignment. This prevents ABI changes depending on whether or not native vector modes are supported. */ - TYPE_ALIGN (type) = targetm.vector_alignment (type); + SET_TYPE_ALIGN (type, targetm.vector_alignment (type)); /* However, if the underlying mode requires a bigger alignment than what the target hook provides, we cannot use the mode. For now, @@ -2207,7 +2207,7 @@ layout_type (tree type) case VOID_TYPE: /* This is an incomplete type and so doesn't have a size. */ - TYPE_ALIGN (type) = 1; + SET_TYPE_ALIGN (type, 1); TYPE_USER_ALIGN (type) = 0; SET_TYPE_MODE (type, VOIDmode); break; @@ -2332,7 +2332,7 @@ layout_type (tree type) #else align = MAX (align, BITS_PER_UNIT); #endif - TYPE_ALIGN (type) = align; + SET_TYPE_ALIGN (type, align); SET_TYPE_MODE (type, BLKmode); if (TYPE_SIZE (type) != 0 && ! targetm.member_type_forces_blk (type, VOIDmode) @@ -2604,13 +2604,13 @@ initialize_sizetypes (void) /* Now layout both types manually. */ SET_TYPE_MODE (sizetype, smallest_mode_for_size (precision, MODE_INT)); - TYPE_ALIGN (sizetype) = GET_MODE_ALIGNMENT (TYPE_MODE (sizetype)); + SET_TYPE_ALIGN (sizetype, GET_MODE_ALIGNMENT (TYPE_MODE (sizetype))); TYPE_SIZE (sizetype) = bitsize_int (precision); TYPE_SIZE_UNIT (sizetype) = size_int (GET_MODE_SIZE (TYPE_MODE (sizetype))); set_min_and_max_values_for_integral_type (sizetype, precision, UNSIGNED); SET_TYPE_MODE (bitsizetype, smallest_mode_for_size (bprecision, MODE_INT)); - TYPE_ALIGN (bitsizetype) = GET_MODE_ALIGNMENT (TYPE_MODE (bitsizetype)); + SET_TYPE_ALIGN (bitsizetype, GET_MODE_ALIGNMENT (TYPE_MODE (bitsizetype))); TYPE_SIZE (bitsizetype) = bitsize_int (bprecision); TYPE_SIZE_UNIT (bitsizetype) = size_int (GET_MODE_SIZE (TYPE_MODE (bitsizetype))); Index: gcc/targhooks.c =================================================================== --- gcc.orig/targhooks.c 2015-12-01 16:09:46.000000000 +0100 +++ gcc/targhooks.c 2015-12-08 16:35:41.000000000 +0100 @@ -1852,7 +1852,7 @@ std_gimplify_va_arg_expr (tree valist, t if (boundary < TYPE_ALIGN (type)) { type = build_variant_type_copy (type); - TYPE_ALIGN (type) = boundary; + SET_TYPE_ALIGN (type, boundary); } /* Compute the rounded size of the type. */ Index: gcc/tree-nested.c =================================================================== --- gcc.orig/tree-nested.c 2015-12-01 16:10:13.000000000 +0100 +++ gcc/tree-nested.c 2015-12-08 17:20:24.000000000 +0100 @@ -192,7 +192,7 @@ insert_field_into_struct (tree type, tre /* Set correct alignment for frame struct type. */ if (TYPE_ALIGN (type) < DECL_ALIGN (field)) - TYPE_ALIGN (type) = DECL_ALIGN (field); + SET_TYPE_ALIGN (type, DECL_ALIGN (field)); } /* Build or return the RECORD_TYPE that describes the frame state that is @@ -275,14 +275,14 @@ lookup_field_for_decl (struct nesting_in if (use_pointer_in_frame (decl)) { TREE_TYPE (field) = build_pointer_type (TREE_TYPE (decl)); - DECL_ALIGN (field) = TYPE_ALIGN (TREE_TYPE (field)); + SET_DECL_ALIGN (field, TYPE_ALIGN (TREE_TYPE (field))); DECL_NONADDRESSABLE_P (field) = 1; } else { TREE_TYPE (field) = TREE_TYPE (decl); DECL_SOURCE_LOCATION (field) = DECL_SOURCE_LOCATION (decl); - DECL_ALIGN (field) = DECL_ALIGN (decl); + SET_DECL_ALIGN (field, DECL_ALIGN (decl)); DECL_USER_ALIGN (field) = DECL_USER_ALIGN (decl); TREE_ADDRESSABLE (field) = TREE_ADDRESSABLE (decl); DECL_NONADDRESSABLE_P (field) = !TREE_ADDRESSABLE (decl); @@ -361,7 +361,7 @@ get_chain_field (struct nesting_info *in field = make_node (FIELD_DECL); DECL_NAME (field) = get_identifier ("__chain"); TREE_TYPE (field) = type; - DECL_ALIGN (field) = TYPE_ALIGN (type); + SET_DECL_ALIGN (field, TYPE_ALIGN (type)); DECL_NONADDRESSABLE_P (field) = 1; insert_field_into_struct (get_frame_type (info), field); @@ -474,7 +474,7 @@ get_trampoline_type (struct nesting_info t = build_array_type (char_type_node, t); t = build_decl (DECL_SOURCE_LOCATION (info->context), FIELD_DECL, get_identifier ("__data"), t); - DECL_ALIGN (t) = align; + SET_DECL_ALIGN (t, align); DECL_USER_ALIGN (t) = 1; trampoline_type = make_node (RECORD_TYPE); @@ -548,7 +548,7 @@ get_nl_goto_field (struct nesting_info * field = make_node (FIELD_DECL); DECL_NAME (field) = get_identifier ("__nl_goto_buf"); TREE_TYPE (field) = type; - DECL_ALIGN (field) = TYPE_ALIGN (type); + SET_DECL_ALIGN (field, TYPE_ALIGN (type)); TREE_ADDRESSABLE (field) = 1; insert_field_into_struct (get_frame_type (info), field); Index: gcc/tree-streamer-in.c =================================================================== --- gcc.orig/tree-streamer-in.c 2015-12-01 16:10:13.000000000 +0100 +++ gcc/tree-streamer-in.c 2015-12-08 17:21:17.000000000 +0100 @@ -226,10 +226,10 @@ unpack_ts_decl_common_value_fields (stru DECL_PRESERVE_P (expr) = (unsigned) bp_unpack_value (bp, 1); DECL_EXTERNAL (expr) = (unsigned) bp_unpack_value (bp, 1); DECL_GIMPLE_REG_P (expr) = (unsigned) bp_unpack_value (bp, 1); - DECL_ALIGN (expr) = (unsigned) bp_unpack_var_len_unsigned (bp); + SET_DECL_ALIGN (expr, (unsigned) bp_unpack_var_len_unsigned (bp)); #ifdef ACCEL_COMPILER if (DECL_ALIGN (expr) > targetm.absolute_biggest_alignment) - DECL_ALIGN (expr) = targetm.absolute_biggest_alignment; + SET_DECL_ALIGN (expr, targetm.absolute_biggest_alignment); #endif if (TREE_CODE (expr) == LABEL_DECL) { @@ -375,10 +375,10 @@ unpack_ts_type_common_value_fields (stru else if (TREE_CODE (expr) == ARRAY_TYPE) TYPE_NONALIASED_COMPONENT (expr) = (unsigned) bp_unpack_value (bp, 1); TYPE_PRECISION (expr) = bp_unpack_var_len_unsigned (bp); - TYPE_ALIGN (expr) = bp_unpack_var_len_unsigned (bp); + SET_TYPE_ALIGN (expr, bp_unpack_var_len_unsigned (bp)); #ifdef ACCEL_COMPILER if (TYPE_ALIGN (expr) > targetm.absolute_biggest_alignment) - TYPE_ALIGN (expr) = targetm.absolute_biggest_alignment; + SET_TYPE_ALIGN (expr, targetm.absolute_biggest_alignment); #endif } Index: gcc/tree.c =================================================================== --- gcc.orig/tree.c 2015-12-01 16:09:47.000000000 +0100 +++ gcc/tree.c 2015-12-08 17:19:33.000000000 +0100 @@ -1020,11 +1020,11 @@ make_node_stat (enum tree_code code MEM_ { if (code == FUNCTION_DECL) { - DECL_ALIGN (t) = FUNCTION_BOUNDARY; + SET_DECL_ALIGN (t, FUNCTION_BOUNDARY); DECL_MODE (t) = FUNCTION_MODE; } else - DECL_ALIGN (t) = 1; + SET_DECL_ALIGN (t, 1); } DECL_SOURCE_LOCATION (t) = input_location; if (TREE_CODE (t) == DEBUG_EXPR_DECL) @@ -1041,7 +1041,7 @@ make_node_stat (enum tree_code code MEM_ case tcc_type: TYPE_UID (t) = next_type_uid++; - TYPE_ALIGN (t) = BITS_PER_UNIT; + SET_TYPE_ALIGN (t, BITS_PER_UNIT); TYPE_USER_ALIGN (t) = 0; TYPE_MAIN_VARIANT (t) = t; TYPE_CANONICAL (t) = t; @@ -6604,7 +6604,7 @@ build_qualified_type (tree type, int typ /* Ensure the alignment of this type is compatible with the required alignment of the atomic type. */ if (TYPE_ALIGN (atomic_type) > TYPE_ALIGN (t)) - TYPE_ALIGN (t) = TYPE_ALIGN (atomic_type); + SET_TYPE_ALIGN (t, TYPE_ALIGN (atomic_type)); } } @@ -6643,7 +6643,7 @@ build_aligned_type (tree type, unsigned return t; t = build_variant_type_copy (type); - TYPE_ALIGN (t) = align; + SET_TYPE_ALIGN (t, align); return t; } @@ -8093,7 +8093,7 @@ build_range_type_1 (tree type, tree lowv SET_TYPE_MODE (itype, TYPE_MODE (type)); TYPE_SIZE (itype) = TYPE_SIZE (type); TYPE_SIZE_UNIT (itype) = TYPE_SIZE_UNIT (type); - TYPE_ALIGN (itype) = TYPE_ALIGN (type); + SET_TYPE_ALIGN (itype, TYPE_ALIGN (type)); TYPE_USER_ALIGN (itype) = TYPE_USER_ALIGN (type); if (!shared) @@ -9994,7 +9994,7 @@ build_atomic_base (tree type, unsigned i set_type_quals (t, TYPE_QUAL_ATOMIC); if (align) - TYPE_ALIGN (t) = align; + SET_TYPE_ALIGN (t, align); return t; } @@ -10145,7 +10145,7 @@ build_common_tree_nodes (bool signed_cha /* 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; + SET_TYPE_ALIGN (void_type_node, BITS_PER_UNIT); TYPE_USER_ALIGN (void_type_node) = 0; void_node = make_node (VOID_CST); Index: gcc/ada/gcc-interface/decl.c =================================================================== --- gcc.orig/ada/gcc-interface/decl.c 2015-12-01 16:10:05.000000000 +0100 +++ gcc/ada/gcc-interface/decl.c 2015-12-08 18:14:55.000000000 +0100 @@ -1792,8 +1792,8 @@ gnat_to_gnu_entity (Entity_Id gnat_entit This means that bit-packed arrays are given "ceil" alignment for their size by default, which may seem counter-intuitive but makes it possible to overlay them on modular types easily. */ - TYPE_ALIGN (gnu_type) - = align > 0 ? align : TYPE_ALIGN (gnu_field_type); + SET_TYPE_ALIGN (gnu_type, + align > 0 ? align : TYPE_ALIGN (gnu_field_type)); /* Propagate the reverse storage order flag to the record type so that the required byte swapping is performed when retrieving the @@ -1850,7 +1850,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entit TYPE_SIZE (gnu_type) = TYPE_SIZE (gnu_field_type); TYPE_SIZE_UNIT (gnu_type) = TYPE_SIZE_UNIT (gnu_field_type); SET_TYPE_ADA_SIZE (gnu_type, TYPE_RM_SIZE (gnu_field_type)); - TYPE_ALIGN (gnu_type) = align; + SET_TYPE_ALIGN (gnu_type, align); relate_alias_sets (gnu_type, gnu_field_type, ALIAS_SET_COPY); /* Don't declare the field as addressable since we won't be taking @@ -2162,9 +2162,10 @@ gnat_to_gnu_entity (Entity_Id gnat_entit if (No (Packed_Array_Impl_Type (gnat_entity)) && Known_Alignment (gnat_entity)) { - TYPE_ALIGN (tem) - = validate_alignment (Alignment (gnat_entity), gnat_entity, - TYPE_ALIGN (tem)); + SET_TYPE_ALIGN (tem, + validate_alignment (Alignment (gnat_entity), + gnat_entity, + TYPE_ALIGN (tem))); if (Present (Alignment_Clause (gnat_entity))) TYPE_USER_ALIGN (tem) = 1; } @@ -2186,7 +2187,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entit TYPE_POINTER_TO (gnu_type) = gnu_fat_type; TYPE_REFERENCE_TO (gnu_type) = gnu_fat_type; SET_TYPE_MODE (gnu_type, BLKmode); - TYPE_ALIGN (gnu_type) = TYPE_ALIGN (tem); + SET_TYPE_ALIGN (gnu_type, TYPE_ALIGN (tem)); /* If the maximum size doesn't overflow, use it. */ if (gnu_max_size @@ -2892,11 +2893,12 @@ gnat_to_gnu_entity (Entity_Id gnat_entit /* Always set the alignment on the record type here so that it can get the proper layout. */ if (has_align) - TYPE_ALIGN (gnu_type) - = validate_alignment (Alignment (gnat_entity), gnat_entity, 0); + SET_TYPE_ALIGN (gnu_type, + validate_alignment (Alignment (gnat_entity), + gnat_entity, 0)); else { - TYPE_ALIGN (gnu_type) = 0; + SET_TYPE_ALIGN (gnu_type, 0); /* If a type needs strict alignment, the minimum size will be the type size instead of the RM size (see validate_size). Cap the @@ -2995,7 +2997,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entit be created with a component clause below, then we need to apply the same adjustment as in gnat_to_gnu_field. */ if (has_rep && TYPE_ALIGN (gnu_type) < TYPE_ALIGN (gnu_parent)) - TYPE_ALIGN (gnu_type) = TYPE_ALIGN (gnu_parent); + SET_TYPE_ALIGN (gnu_type, TYPE_ALIGN (gnu_parent)); /* Finally we fix up both kinds of twisted COMPONENT_REF we have initially built. The discriminants must reference the fields @@ -4439,8 +4441,8 @@ gnat_to_gnu_entity (Entity_Id gnat_entit /* Set a default alignment to speed up accesses. But we shouldn't increase the size of the structure too much, lest it doesn't fit in return registers anymore. */ - TYPE_ALIGN (gnu_return_type) - = get_mode_alignment (ptr_mode); + SET_TYPE_ALIGN (gnu_return_type, + get_mode_alignment (ptr_mode)); } gnu_field @@ -4487,8 +4489,8 @@ gnat_to_gnu_entity (Entity_Id gnat_entit if (mode != BLKmode) { SET_TYPE_MODE (gnu_return_type, mode); - TYPE_ALIGN (gnu_return_type) - = GET_MODE_ALIGNMENT (mode); + SET_TYPE_ALIGN (gnu_return_type, + GET_MODE_ALIGNMENT (mode)); TYPE_SIZE (gnu_return_type) = bitsize_int (GET_MODE_BITSIZE (mode)); TYPE_SIZE_UNIT (gnu_return_type) @@ -6652,7 +6654,7 @@ gnat_to_gnu_field (Entity_Id gnat_field, const unsigned int type_align = TYPE_ALIGN (gnu_field_type); if (TYPE_ALIGN (gnu_record_type) < type_align) - TYPE_ALIGN (gnu_record_type) = type_align; + SET_TYPE_ALIGN (gnu_record_type, type_align); /* If the position is not a multiple of the alignment of the type, then error out and reset the position. */ @@ -7137,7 +7139,7 @@ components_to_record (tree gnu_record_ty = make_node (unchecked_union ? UNION_TYPE : QUAL_UNION_TYPE); TYPE_NAME (gnu_union_type) = gnu_union_name; - TYPE_ALIGN (gnu_union_type) = 0; + SET_TYPE_ALIGN (gnu_union_type, 0); TYPE_PACKED (gnu_union_type) = TYPE_PACKED (gnu_record_type); TYPE_REVERSE_STORAGE_ORDER (gnu_union_type) = TYPE_REVERSE_STORAGE_ORDER (gnu_record_type); @@ -7190,7 +7192,7 @@ components_to_record (tree gnu_record_ty /* Set the alignment of the inner type in case we need to make inner objects into bitfields, but then clear it out so the record actually gets only the alignment required. */ - TYPE_ALIGN (gnu_variant_type) = TYPE_ALIGN (gnu_record_type); + SET_TYPE_ALIGN (gnu_variant_type, TYPE_ALIGN (gnu_record_type)); TYPE_PACKED (gnu_variant_type) = TYPE_PACKED (gnu_record_type); TYPE_REVERSE_STORAGE_ORDER (gnu_variant_type) = TYPE_REVERSE_STORAGE_ORDER (gnu_record_type); @@ -7422,9 +7424,9 @@ components_to_record (tree gnu_record_ty SET_DECL_OFFSET_ALIGN (gnu_field, BIGGEST_ALIGNMENT); DECL_FIELD_BIT_OFFSET (gnu_field) = bitsize_zero_node; if (field_is_aliased (gnu_field)) - TYPE_ALIGN (gnu_record_type) - = MAX (TYPE_ALIGN (gnu_record_type), - TYPE_ALIGN (TREE_TYPE (gnu_field))); + SET_TYPE_ALIGN (gnu_record_type, + MAX (TYPE_ALIGN (gnu_record_type), + TYPE_ALIGN (TREE_TYPE (gnu_field)))); MOVE_FROM_FIELD_LIST_TO (gnu_zero_list); continue; } @@ -7516,7 +7518,7 @@ components_to_record (tree gnu_record_ty gnu_field_list = chainon (gnu_field_list, gnu_variant_part); if (cancel_alignment) - TYPE_ALIGN (gnu_record_type) = 0; + SET_TYPE_ALIGN (gnu_record_type, 0); TYPE_ARTIFICIAL (gnu_record_type) = artificial; @@ -8622,7 +8624,7 @@ create_variant_part_from (tree old_varia SET_TYPE_ADA_SIZE (new_union_type, size_binop (MINUS_EXPR, TYPE_ADA_SIZE (record_type), first_bit)); - TYPE_ALIGN (new_union_type) = TYPE_ALIGN (old_union_type); + SET_TYPE_ALIGN (new_union_type, TYPE_ALIGN (old_union_type)); relate_alias_sets (new_union_type, old_union_type, ALIAS_SET_COPY); } else @@ -8719,7 +8721,7 @@ copy_and_substitute_in_size (tree new_ty TYPE_SIZE (new_type) = TYPE_SIZE (old_type); TYPE_SIZE_UNIT (new_type) = TYPE_SIZE_UNIT (old_type); SET_TYPE_ADA_SIZE (new_type, TYPE_ADA_SIZE (old_type)); - TYPE_ALIGN (new_type) = TYPE_ALIGN (old_type); + SET_TYPE_ALIGN (new_type, TYPE_ALIGN (old_type)); relate_alias_sets (new_type, old_type, ALIAS_SET_COPY); if (CONTAINS_PLACEHOLDER_P (TYPE_SIZE (new_type))) @@ -8849,7 +8851,7 @@ substitute_in_type (tree t, tree f, tree return t; nt = build_nonshared_array_type (component, domain); - TYPE_ALIGN (nt) = TYPE_ALIGN (t); + SET_TYPE_ALIGN (nt, TYPE_ALIGN (t)); TYPE_USER_ALIGN (nt) = TYPE_USER_ALIGN (t); SET_TYPE_MODE (nt, TYPE_MODE (t)); TYPE_SIZE (nt) = SUBSTITUTE_IN_EXPR (TYPE_SIZE (t), f, r); Index: gcc/ada/gcc-interface/utils.c =================================================================== --- gcc.orig/ada/gcc-interface/utils.c 2015-12-01 16:10:05.000000000 +0100 +++ gcc/ada/gcc-interface/utils.c 2015-12-08 18:12:08.000000000 +0100 @@ -902,7 +902,7 @@ make_aligning_type (tree type, unsigned pos, 1, -1); TYPE_FIELDS (record_type) = field; - TYPE_ALIGN (record_type) = base_align; + SET_TYPE_ALIGN (record_type, base_align); TYPE_USER_ALIGN (record_type) = 1; TYPE_SIZE (record_type) @@ -961,7 +961,7 @@ make_packable_type (tree type, bool in_r if (in_record && size <= MAX_FIXED_MODE_SIZE) { align = ceil_pow2 (size); - TYPE_ALIGN (new_type) = align; + SET_TYPE_ALIGN (new_type, align); new_size = (size + align - 1) & -align; } else @@ -981,7 +981,7 @@ make_packable_type (tree type, bool in_r return type; align = new_size & -new_size; - TYPE_ALIGN (new_type) = MIN (TYPE_ALIGN (type), align); + SET_TYPE_ALIGN (new_type, MIN (TYPE_ALIGN (type), align)); } TYPE_USER_ALIGN (new_type) = 1; @@ -1282,7 +1282,7 @@ maybe_pad_type (tree type, tree size, un if (Present (gnat_entity)) TYPE_NAME (record) = create_concat_name (gnat_entity, "PAD"); - TYPE_ALIGN (record) = align ? align : orig_align; + SET_TYPE_ALIGN (record, align ? align : orig_align); TYPE_SIZE (record) = size ? size : orig_size; TYPE_SIZE_UNIT (record) = convert (sizetype, @@ -1573,7 +1573,7 @@ finish_fat_pointer_type (tree record_typ { /* Make sure we can put it into a register. */ if (STRICT_ALIGNMENT) - TYPE_ALIGN (record_type) = MIN (BIGGEST_ALIGNMENT, 2 * POINTER_SIZE); + SET_TYPE_ALIGN (record_type, MIN (BIGGEST_ALIGNMENT, 2 * POINTER_SIZE)); /* Show what it really is. */ TYPE_FAT_POINTER_P (record_type) = 1; @@ -1620,7 +1620,8 @@ finish_record_type (tree record_type, tr that just means some initializations; otherwise, layout the record. */ if (rep_level > 0) { - TYPE_ALIGN (record_type) = MAX (BITS_PER_UNIT, TYPE_ALIGN (record_type)); + SET_TYPE_ALIGN (record_type, MAX (BITS_PER_UNIT, + TYPE_ALIGN (record_type))); if (!had_size_unit) TYPE_SIZE_UNIT (record_type) = size_zero_node; @@ -1698,7 +1699,7 @@ finish_record_type (tree record_type, tr maximum alignment, if any. */ if (TYPE_ALIGN (record_type) >= align) { - DECL_ALIGN (field) = MAX (DECL_ALIGN (field), align); + SET_DECL_ALIGN (field, MAX (DECL_ALIGN (field), align)); DECL_BIT_FIELD (field) = 0; } else if (!had_align @@ -1707,8 +1708,8 @@ finish_record_type (tree record_type, tr && (!TYPE_MAX_ALIGN (record_type) || TYPE_MAX_ALIGN (record_type) >= align)) { - TYPE_ALIGN (record_type) = align; - DECL_ALIGN (field) = MAX (DECL_ALIGN (field), align); + SET_TYPE_ALIGN (record_type, align); + SET_DECL_ALIGN (field, MAX (DECL_ALIGN (field), align)); DECL_BIT_FIELD (field) = 0; } } @@ -1731,8 +1732,8 @@ finish_record_type (tree record_type, tr /* A type must be as aligned as its most aligned field that is not a bit-field. But this is already enforced by layout_type. */ if (rep_level > 0 && !DECL_BIT_FIELD (field)) - TYPE_ALIGN (record_type) - = MAX (TYPE_ALIGN (record_type), DECL_ALIGN (field)); + SET_TYPE_ALIGN (record_type, + MAX (TYPE_ALIGN (record_type), DECL_ALIGN (field))); switch (code) { @@ -1903,7 +1904,7 @@ rest_of_record_type_compilation (tree re = concat_name (orig_name, TREE_CODE (record_type) == QUAL_UNION_TYPE ? "XVU" : "XVE"); TYPE_NAME (new_record_type) = new_name; - TYPE_ALIGN (new_record_type) = BIGGEST_ALIGNMENT; + SET_TYPE_ALIGN (new_record_type, BIGGEST_ALIGNMENT); TYPE_STUB_DECL (new_record_type) = create_type_stub_decl (new_name, new_record_type); DECL_IGNORED_P (TYPE_STUB_DECL (new_record_type)) @@ -1994,7 +1995,7 @@ rest_of_record_type_compilation (tree re if (align != 0 && TYPE_ALIGN (field_type) > align) { field_type = copy_node (field_type); - TYPE_ALIGN (field_type) = align; + SET_TYPE_ALIGN (field_type, align); } var = true; } @@ -2524,7 +2525,7 @@ create_field_decl (tree name, tree type, || (!pos && AGGREGATE_TYPE_P (type) && aggregate_type_contains_array_p (type)))) - DECL_ALIGN (field_decl) = BITS_PER_UNIT; + SET_DECL_ALIGN (field_decl, BITS_PER_UNIT); /* If a size is specified, use it. Otherwise, if the record type is packed compute a size to use, which may differ from the object's natural size. @@ -2571,9 +2572,9 @@ create_field_decl (tree name, tree type, { if (TYPE_ALIGN (record_type) != 0 && TYPE_ALIGN (record_type) < TYPE_ALIGN (type)) - DECL_ALIGN (field_decl) = TYPE_ALIGN (record_type); + SET_DECL_ALIGN (field_decl, TYPE_ALIGN (record_type)); else - DECL_ALIGN (field_decl) = TYPE_ALIGN (type); + SET_DECL_ALIGN (field_decl, TYPE_ALIGN (type)); } } @@ -2589,10 +2590,10 @@ create_field_decl (tree name, tree type, : packed && TYPE_MODE (type) != BLKmode ? BITS_PER_UNIT : 0); if (bit_align > DECL_ALIGN (field_decl)) - DECL_ALIGN (field_decl) = bit_align; + SET_DECL_ALIGN (field_decl, bit_align); else if (!bit_align && TYPE_ALIGN (type) > DECL_ALIGN (field_decl)) { - DECL_ALIGN (field_decl) = TYPE_ALIGN (type); + SET_DECL_ALIGN (field_decl, TYPE_ALIGN (type)); DECL_USER_ALIGN (field_decl) = TYPE_USER_ALIGN (type); } } Index: gcc/cfgexpand.c =================================================================== --- gcc.orig/cfgexpand.c 2015-12-01 16:10:12.000000000 +0100 +++ gcc/cfgexpand.c 2015-12-08 17:12:43.000000000 +0100 @@ -361,7 +361,7 @@ align_local_variable (tree decl) else { align = LOCAL_DECL_ALIGNMENT (decl); - DECL_ALIGN (decl) = align; + SET_DECL_ALIGN (decl, align); } return align / BITS_PER_UNIT; } @@ -998,7 +998,7 @@ expand_one_stack_var_at (tree decl, rtx alignment here, but (at least) the i386 port does exactly this via the MINIMUM_ALIGNMENT hook. */ - DECL_ALIGN (decl) = align; + SET_DECL_ALIGN (decl, align); DECL_USER_ALIGN (decl) = 0; } Index: gcc/config/arm/arm.c =================================================================== --- gcc.orig/config/arm/arm.c 2015-12-01 16:10:18.000000000 +0100 +++ gcc/config/arm/arm.c 2015-12-08 17:23:19.000000000 +0100 @@ -29863,8 +29863,8 @@ arm_relayout_function (tree fndecl) if (!callee_tree) callee_tree = target_option_default_node; - DECL_ALIGN (fndecl) = - FUNCTION_BOUNDARY_P (TREE_TARGET_OPTION (callee_tree)->x_target_flags); + SET_DECL_ALIGN (fndecl, + FUNCTION_BOUNDARY_P (TREE_TARGET_OPTION (callee_tree)->x_target_flags)); } /* Inner function to process the attribute((target(...))), take an argument and Index: gcc/config/spu/spu.c =================================================================== --- gcc.orig/config/spu/spu.c 2015-12-01 16:10:14.000000000 +0100 +++ gcc/config/spu/spu.c 2015-12-08 17:23:51.000000000 +0100 @@ -3915,11 +3915,11 @@ spu_build_builtin_va_list (void) FIELD_DECL, get_identifier ("__skip"), ptr_type_node); DECL_FIELD_CONTEXT (f_args) = record; - DECL_ALIGN (f_args) = 128; + SET_DECL_ALIGN (f_args, 128); DECL_USER_ALIGN (f_args) = 1; DECL_FIELD_CONTEXT (f_skip) = record; - DECL_ALIGN (f_skip) = 128; + SET_DECL_ALIGN (f_skip, 128); DECL_USER_ALIGN (f_skip) = 1; TYPE_STUB_DECL (record) = type_decl; Index: gcc/coverage.c =================================================================== --- gcc.orig/coverage.c 2015-11-04 17:37:01.000000000 +0100 +++ gcc/coverage.c 2015-12-08 17:12:57.000000000 +0100 @@ -755,7 +755,7 @@ build_var (tree fn_decl, tree type, int TREE_STATIC (var) = 1; TREE_ADDRESSABLE (var) = 1; DECL_NONALIASED (var) = 1; - DECL_ALIGN (var) = TYPE_ALIGN (type); + SET_DECL_ALIGN (var, TYPE_ALIGN (type)); return var; } Index: gcc/cp/lambda.c =================================================================== --- gcc.orig/cp/lambda.c 2015-12-01 16:09:51.000000000 +0100 +++ gcc/cp/lambda.c 2015-12-08 17:27:08.000000000 +0100 @@ -1000,7 +1000,7 @@ maybe_add_lambda_conv_op (tree type) tree convfn = build_lang_decl (FUNCTION_DECL, name, fntype); tree fn = convfn; DECL_SOURCE_LOCATION (fn) = DECL_SOURCE_LOCATION (callop); - DECL_ALIGN (fn) = MINIMUM_METHOD_BOUNDARY; + SET_DECL_ALIGN (fn, MINIMUM_METHOD_BOUNDARY); SET_OVERLOADED_OPERATOR_CODE (fn, TYPE_EXPR); grokclassfn (type, fn, NO_SPECIAL); set_linkage_according_to_type (type, fn); Index: gcc/cp/method.c =================================================================== --- gcc.orig/cp/method.c 2015-12-01 16:09:51.000000000 +0100 +++ gcc/cp/method.c 2015-12-08 17:26:20.000000000 +0100 @@ -1840,7 +1840,7 @@ implicitly_declare_fn (special_function_ SET_OVERLOADED_OPERATOR_CODE (fn, NOP_EXPR); } - DECL_ALIGN (fn) = MINIMUM_METHOD_BOUNDARY; + SET_DECL_ALIGN (fn, MINIMUM_METHOD_BOUNDARY); /* Create the explicit arguments. */ if (rhs_parm_type) Index: gcc/cp/rtti.c =================================================================== --- gcc.orig/cp/rtti.c 2015-12-01 16:09:51.000000000 +0100 +++ gcc/cp/rtti.c 2015-12-08 17:26:56.000000000 +0100 @@ -1602,7 +1602,7 @@ emit_tinfo_decl (tree decl) /* Avoid targets optionally bumping up the alignment to improve vector instruction accesses, tinfo are never accessed this way. */ #ifdef DATA_ABI_ALIGNMENT - DECL_ALIGN (decl) = DATA_ABI_ALIGNMENT (decl, TYPE_ALIGN (TREE_TYPE (decl))); + SET_DECL_ALIGN (decl, DATA_ABI_ALIGNMENT (decl, TYPE_ALIGN (TREE_TYPE (decl)))); DECL_USER_ALIGN (decl) = true; #endif return true; Index: gcc/except.c =================================================================== --- gcc.orig/except.c 2015-12-01 16:10:12.000000000 +0100 +++ gcc/except.c 2015-12-08 17:13:11.000000000 +0100 @@ -300,7 +300,7 @@ init_eh (void) #ifdef DONT_USE_BUILTIN_SETJMP /* We don't know what the alignment requirements of the runtime's jmp_buf has. Overestimate. */ - DECL_ALIGN (f_jbuf) = BIGGEST_ALIGNMENT; + SET_DECL_ALIGN (f_jbuf, BIGGEST_ALIGNMENT); DECL_USER_ALIGN (f_jbuf) = 1; #endif DECL_FIELD_CONTEXT (f_jbuf) = sjlj_fc_type_node; Index: gcc/fortran/trans-common.c =================================================================== --- gcc.orig/fortran/trans-common.c 2015-12-01 16:10:08.000000000 +0100 +++ gcc/fortran/trans-common.c 2015-12-08 17:28:32.000000000 +0100 @@ -438,7 +438,7 @@ build_common_decl (gfc_common_head *com, TREE_STATIC (decl) = 1; DECL_IGNORED_P (decl) = 1; if (!com->is_bind_c) - DECL_ALIGN (decl) = BIGGEST_ALIGNMENT; + SET_DECL_ALIGN (decl, BIGGEST_ALIGNMENT); else { /* Do not set the alignment for bind(c) common blocks to @@ -449,7 +449,7 @@ build_common_decl (gfc_common_head *com, tree field = NULL_TREE; field = TYPE_FIELDS (TREE_TYPE (decl)); if (DECL_CHAIN (field) == NULL_TREE) - DECL_ALIGN (decl) = TYPE_ALIGN (TREE_TYPE (field)); + SET_DECL_ALIGN (decl, TYPE_ALIGN (TREE_TYPE (field))); } DECL_USER_ALIGN (decl) = 0; GFC_DECL_COMMON_OR_EQUIV (decl) = 1; Index: gcc/fortran/trans-types.c =================================================================== --- gcc.orig/fortran/trans-types.c 2015-12-01 16:10:08.000000000 +0100 +++ gcc/fortran/trans-types.c 2015-12-08 17:28:04.000000000 +0100 @@ -2273,7 +2273,7 @@ gfc_add_field_to_struct (tree context, t tree decl = gfc_add_field_to_struct_1 (context, name, type, chain); DECL_INITIAL (decl) = 0; - DECL_ALIGN (decl) = 0; + SET_DECL_ALIGN (decl, 0); DECL_USER_ALIGN (decl) = 0; return decl; Index: gcc/function.c =================================================================== --- gcc.orig/function.c 2015-12-01 16:10:11.000000000 +0100 +++ gcc/function.c 2015-12-08 17:13:22.000000000 +0100 @@ -2920,7 +2920,7 @@ assign_parm_setup_block (struct assign_p size_stored = CEIL_ROUND (size, UNITS_PER_WORD); if (stack_parm == 0) { - DECL_ALIGN (parm) = MAX (DECL_ALIGN (parm), BITS_PER_WORD); + SET_DECL_ALIGN (parm, MAX (DECL_ALIGN (parm), BITS_PER_WORD)); stack_parm = assign_stack_local (BLKmode, size_stored, DECL_ALIGN (parm)); if (GET_MODE_SIZE (GET_MODE (entry_parm)) == size) Index: gcc/go/go-gcc.cc =================================================================== --- gcc.orig/go/go-gcc.cc 2015-12-01 16:09:53.000000000 +0100 +++ gcc/go/go-gcc.cc 2015-12-08 17:29:55.000000000 +0100 @@ -2643,7 +2643,7 @@ Gcc_backend::implicit_variable(const std } if (alignment != 0) { - DECL_ALIGN(decl) = alignment * BITS_PER_UNIT; + SET_DECL_ALIGN(decl, alignment * BITS_PER_UNIT); DECL_USER_ALIGN(decl) = 1; } Index: gcc/java/class.c =================================================================== --- gcc.orig/java/class.c 2015-12-01 16:09:46.000000000 +0100 +++ gcc/java/class.c 2015-12-08 17:29:42.000000000 +0100 @@ -773,7 +773,7 @@ add_method_1 (tree this_class, int acces TYPE_METHODS (this_class) = fndecl; if (!(access_flags & ACC_STATIC)) - DECL_ALIGN (fndecl) = MINIMUM_METHOD_BOUNDARY; + SET_DECL_ALIGN (fndecl, MINIMUM_METHOD_BOUNDARY); /* Notice that this is a finalizer and update the class type accordingly. This is used to optimize instance allocation. */ @@ -2207,11 +2207,11 @@ make_class_data (tree type) FINISH_RECORD_CONSTRUCTOR (cons, v2, class_type_node); DECL_INITIAL (decl) = cons; - + /* Hash synchronization requires at least 64-bit alignment. */ if (flag_hash_synchronization && POINTER_SIZE < 64) - DECL_ALIGN (decl) = 64; - + SET_DECL_ALIGN (decl, 64); + if (flag_indirect_classes) { TREE_READONLY (decl) = 1; @@ -2790,7 +2790,7 @@ emit_register_classes_in_jcr_section (vo cdecl = build_decl (UNKNOWN_LOCATION, VAR_DECL, get_identifier ("_Jv_JCR_SECTION_data"), class_array_type); - DECL_ALIGN (cdecl) = POINTER_SIZE; + SET_DECL_ALIGN (cdecl, POINTER_SIZE); DECL_USER_ALIGN (cdecl) = 1; DECL_INITIAL (cdecl) = build_constructor (class_array_type, init); TREE_CONSTANT (DECL_INITIAL (cdecl)) = 1; Index: gcc/java/typeck.c =================================================================== --- gcc.orig/java/typeck.c 2015-12-01 16:09:46.000000000 +0100 +++ gcc/java/typeck.c 2015-12-08 17:28:55.000000000 +0100 @@ -305,7 +305,7 @@ build_java_array_type (tree element_type FIELD_DECL, get_identifier ("data"), atype); DECL_CONTEXT (arfld) = t; DECL_CHAIN (fld) = arfld; - DECL_ALIGN (arfld) = TYPE_ALIGN (element_type); + SET_DECL_ALIGN (arfld, TYPE_ALIGN (element_type)); /* We could layout_class, but that loads java.lang.Object prematurely. * This is called by the parser, and it is a bad idea to do load_class Index: gcc/objc/objc-act.c =================================================================== --- gcc.orig/objc/objc-act.c 2015-12-01 16:09:49.000000000 +0100 +++ gcc/objc/objc-act.c 2015-12-08 17:28:42.000000000 +0100 @@ -2115,7 +2115,7 @@ objc_build_struct (tree klass, tree fiel = size_binop (FLOOR_DIV_EXPR, convert (sizetype, DECL_SIZE (base)), size_int (BITS_PER_UNIT)); DECL_ARTIFICIAL (base) = 1; - DECL_ALIGN (base) = 1; + SET_DECL_ALIGN (base, 1); DECL_FIELD_CONTEXT (base) = s; #ifdef OBJCPLUS DECL_FIELD_IS_BASE (base) = 1; Index: gcc/symtab.c =================================================================== --- gcc.orig/symtab.c 2015-12-01 16:10:13.000000000 +0100 +++ gcc/symtab.c 2015-12-08 17:19:11.000000000 +0100 @@ -1956,7 +1956,7 @@ increase_alignment_1 (symtab_node *n, vo if (DECL_ALIGN (n->decl) < align && n->can_increase_alignment_p ()) { - DECL_ALIGN (n->decl) = align; + SET_DECL_ALIGN (n->decl, align); DECL_USER_ALIGN (n->decl) = 1; } return false; Index: gcc/tree-ssa-ccp.c =================================================================== --- gcc.orig/tree-ssa-ccp.c 2015-12-01 16:09:52.000000000 +0100 +++ gcc/tree-ssa-ccp.c 2015-12-08 17:20:45.000000000 +0100 @@ -2114,7 +2114,7 @@ fold_builtin_alloca_with_align (gimple * n_elem = size * 8 / BITS_PER_UNIT; array_type = build_array_type_nelts (elem_type, n_elem); var = create_tmp_var (array_type); - DECL_ALIGN (var) = TREE_INT_CST_LOW (gimple_call_arg (stmt, 1)); + SET_DECL_ALIGN (var, TREE_INT_CST_LOW (gimple_call_arg (stmt, 1))); { struct ptr_info_def *pi = SSA_NAME_PTR_INFO (lhs); if (pi != NULL && !pi->pt.anything) Index: gcc/tree-vect-stmts.c =================================================================== --- gcc.orig/tree-vect-stmts.c 2015-12-01 16:10:13.000000000 +0100 +++ gcc/tree-vect-stmts.c 2015-12-08 17:21:34.000000000 +0100 @@ -5093,7 +5093,7 @@ ensure_base_align (stmt_vec_info stmt_in symtab_node::get (base_decl)->increase_alignment (TYPE_ALIGN (vectype)); else { - DECL_ALIGN (base_decl) = TYPE_ALIGN (vectype); + SET_DECL_ALIGN (base_decl, TYPE_ALIGN (vectype)); DECL_USER_ALIGN (base_decl) = 1; } DR_VECT_AUX (dr)->base_misaligned = false; Index: gcc/varasm.c =================================================================== --- gcc.orig/varasm.c 2015-12-01 16:10:13.000000000 +0100 +++ gcc/varasm.c 2015-12-09 17:09:26.000000000 +0100 @@ -1053,7 +1053,7 @@ align_variable (tree decl, bool dont_out /* Reset the alignment in case we have made it tighter, so we can benefit from it in get_pointer_alignment. */ - DECL_ALIGN (decl) = align; + SET_DECL_ALIGN (decl, align); } /* Return DECL_ALIGN (decl), possibly increased for optimization purposes @@ -2184,8 +2184,8 @@ assemble_variable (tree decl, int top_le && asan_protect_global (decl)) { asan_protected = true; - DECL_ALIGN (decl) = MAX (DECL_ALIGN (decl), - ASAN_RED_ZONE_SIZE * BITS_PER_UNIT); + SET_DECL_ALIGN (decl, MAX (DECL_ALIGN (decl), + ASAN_RED_ZONE_SIZE * BITS_PER_UNIT)); } set_mem_align (decl_rtl, DECL_ALIGN (decl)); @@ -3246,7 +3246,7 @@ build_constant_desc (tree exp) architectures so use DATA_ALIGNMENT as well, except for strings. */ if (TREE_CODE (exp) == STRING_CST) { - DECL_ALIGN (decl) = CONSTANT_ALIGNMENT (exp, DECL_ALIGN (decl)); + SET_DECL_ALIGN (decl, CONSTANT_ALIGNMENT (exp, DECL_ALIGN (decl))); } else align_variable (decl, 0); @@ -3401,8 +3401,8 @@ output_constant_def_contents (rtx symbol && asan_protect_global (exp)) { asan_protected = true; - DECL_ALIGN (decl) = MAX (DECL_ALIGN (decl), - ASAN_RED_ZONE_SIZE * BITS_PER_UNIT); + SET_DECL_ALIGN (decl, MAX (DECL_ALIGN (decl), + ASAN_RED_ZONE_SIZE * BITS_PER_UNIT)); } /* If the constant is part of an object block, make sure that the Index: libcc1/plugin.cc =================================================================== --- libcc1/plugin.cc (revision 231115) +++ libcc1/plugin.cc (working copy) @@ -553,8 +553,8 @@ plugin_finish_record_or_union (cc1_plugi { // FIXME there's no way to get this from DWARF, // or even, it seems, a particularly good way to deduce it. - TYPE_ALIGN (record_or_union_type) - = TYPE_PRECISION (pointer_sized_int_node); + SET_TYPE_ALIGN (record_or_union_type, + TYPE_PRECISION (pointer_sized_int_node)); TYPE_SIZE (record_or_union_type) = bitsize_int (size_in_bytes * BITS_PER_UNIT);