* tree.h (TYPE_ALIGN, DECL_ALIGN): Return shifted amount. 77/189277/2
authormatz <matz@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 18 Apr 2016 20:36:27 +0000 (20:36 +0000)
committerMikhail Kashkarov <m.kashkarov@partner.samsung.com>
Thu, 18 Oct 2018 13:20:07 +0000 (16:20 +0300)
(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.
* gimple-expr.c (copy_var_decl): Use SET_DECL_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 and SET_TYPE_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.
(fixup_attribute_variants): Use SET_TYPE_ALIGN.
* decl.c (duplicate_decls): Use SET_DECL_ALIGN.
(record_unknown_type): Use SET_TYPE_ALIGN.
(cxx_init_decl_processing): Ditto.
(copy_type_enum): 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.

upstream hash: 5d4b30ea56c1733a9149b59105b9645c115cc123
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@235172 138bc75d-0d04-0410-961f-82ee72b054a4

Change-Id: Ia135e37556ac5bc0e2db4cc2a940d8d31e243ade

42 files changed:
gcc/ada/gcc-interface/decl.c
gcc/ada/gcc-interface/utils.c
gcc/c-family/c-common.c
gcc/c/c-decl.c
gcc/cfgexpand.c
gcc/config/arm/arm.c
gcc/config/avr/avr.c
gcc/config/mips/mips.c
gcc/config/msp430/msp430.c
gcc/config/spu/spu.c
gcc/coverage.c
gcc/cp/class.c
gcc/cp/decl.c
gcc/cp/lambda.c
gcc/cp/method.c
gcc/cp/pt.c
gcc/cp/rtti.c
gcc/cp/tree.c
gcc/except.c
gcc/expr.c
gcc/fortran/trans-common.c
gcc/fortran/trans-io.c
gcc/fortran/trans-types.c
gcc/function.c
gcc/gimple-expr.c
gcc/go/go-gcc.cc
gcc/java/class.c
gcc/java/typeck.c
gcc/objc/objc-act.c
gcc/omp-low.c
gcc/stor-layout.c
gcc/symtab.c
gcc/targhooks.c
gcc/tree-core.h
gcc/tree-nested.c
gcc/tree-ssa-ccp.c
gcc/tree-streamer-in.c
gcc/tree-vect-stmts.c
gcc/tree.c
gcc/tree.h
gcc/varasm.c
libcc1/plugin.cc

index 4290e9b..fc06514 100644 (file)
@@ -1896,8 +1896,8 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
             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
@@ -1961,7 +1961,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
          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
@@ -2273,9 +2273,10 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
        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;
          }
@@ -2304,7 +2305,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
        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
@@ -3045,11 +3046,12 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
        /* 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
@@ -3148,7 +3150,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
               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
@@ -4575,8 +4577,8 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
                    /* 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
@@ -4623,8 +4625,8 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
                    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)
@@ -6806,7 +6808,7 @@ gnat_to_gnu_field (Entity_Id gnat_field, tree gnu_record_type, int packed,
          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.  */
@@ -7293,7 +7295,7 @@ components_to_record (tree gnu_record_type, Node_Id gnat_component_list,
            = 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);
@@ -7346,7 +7348,7 @@ components_to_record (tree gnu_record_type, Node_Id gnat_component_list,
          /* 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);
@@ -7578,9 +7580,9 @@ components_to_record (tree gnu_record_type, Node_Id gnat_component_list,
          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;
        }
@@ -7691,7 +7693,7 @@ components_to_record (tree gnu_record_type, Node_Id gnat_component_list,
     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;
 
@@ -8804,7 +8806,7 @@ create_variant_part_from (tree old_variant_part,
       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
@@ -8901,7 +8903,7 @@ copy_and_substitute_in_size (tree new_type, tree old_type,
   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)))
@@ -9044,7 +9046,7 @@ substitute_in_type (tree t, tree f, tree r)
          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 c47be7d..90277a7 100644 (file)
@@ -910,7 +910,7 @@ make_aligning_type (tree type, unsigned int align, tree size,
                             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)
@@ -969,7 +969,7 @@ make_packable_type (tree type, bool in_record)
   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
@@ -989,7 +989,7 @@ make_packable_type (tree type, bool in_record)
        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;
@@ -1301,7 +1301,7 @@ maybe_pad_type (tree type, tree size, unsigned int align,
   else 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,
@@ -1674,7 +1674,7 @@ finish_fat_pointer_type (tree record_type, tree field_list)
 {
   /* 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;
@@ -1721,7 +1721,8 @@ finish_record_type (tree record_type, tree field_list, int rep_level,
      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;
@@ -1799,7 +1800,7 @@ finish_record_type (tree record_type, tree field_list, int rep_level,
                 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
@@ -1808,8 +1809,8 @@ finish_record_type (tree record_type, tree field_list, int rep_level,
                       && (!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;
                }
            }
@@ -1832,8 +1833,8 @@ finish_record_type (tree record_type, tree field_list, int rep_level,
       /* 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)
        {
@@ -2004,7 +2005,7 @@ rest_of_record_type_compilation (tree record_type)
        = 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))
@@ -2096,7 +2097,7 @@ rest_of_record_type_compilation (tree record_type)
              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;
            }
@@ -2644,7 +2645,7 @@ create_field_decl (tree name, tree type, tree record_type, tree size, tree pos,
                 || (!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.
@@ -2691,9 +2692,9 @@ create_field_decl (tree name, tree type, tree record_type, tree size, tree pos,
        {
          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));
        }
     }
 
@@ -2709,10 +2710,10 @@ create_field_decl (tree name, tree type, tree record_type, tree size, tree pos,
         : 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 7068034..2a0006c 100644 (file)
@@ -7879,7 +7879,7 @@ handle_aligned_attribute (tree *node, tree ARG_UNUSED (name), tree args,
       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)
@@ -7913,7 +7913,7 @@ handle_aligned_attribute (tree *node, tree ARG_UNUSED (name), tree args,
     }
   else
     {
-      DECL_ALIGN (decl) = (1U << i) * BITS_PER_UNIT;
+      SET_DECL_ALIGN (decl, (1U << i) * BITS_PER_UNIT);
       DECL_USER_ALIGN (decl) = 1;
     }
 
index e8bafed..5d50fc2 100644 (file)
@@ -2369,7 +2369,7 @@ merge_decls (tree newdecl, tree olddecl, tree newtype, tree oldtype)
       if (TYPE_USER_ALIGN (tem))
        {
          if (TYPE_ALIGN (tem) > TYPE_ALIGN (newtype))
-           TYPE_ALIGN (newtype) = TYPE_ALIGN (tem);
+           SET_TYPE_ALIGN (newtype, TYPE_ALIGN (tem));
          TYPE_USER_ALIGN (newtype) = true;
        }
 
@@ -2410,7 +2410,7 @@ merge_decls (tree newdecl, tree olddecl, tree newtype, tree oldtype)
       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);
        }
     }
@@ -6775,7 +6775,7 @@ grokdeclarator (const struct c_declarator *declarator,
     /* 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;
       }
 
@@ -7217,7 +7217,7 @@ parser_xref_tag (location_t loc, enum tree_code code, tree name)
       /* 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);
@@ -8113,7 +8113,7 @@ finish_enum (tree enumtype, tree values, tree attributes)
   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;
   TYPE_PRECISION (enumtype) = TYPE_PRECISION (tem);
 
@@ -8175,7 +8175,7 @@ finish_enum (tree enumtype, tree values, tree attributes)
       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 b612293..21f21c9 100644 (file)
@@ -369,7 +369,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;
 }
@@ -1018,7 +1018,7 @@ expand_one_stack_var_at (tree decl, rtx base, unsigned base_align,
         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 b199529..181c304 100644 (file)
@@ -30254,8 +30254,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);
+  struct cl_target_option *opts = TREE_TARGET_OPTION (callee_tree);
+  SET_DECL_ALIGN (fndecl, FUNCTION_BOUNDARY_P (opts->x_target_flags));
 }
 
 /* Inner function to process the attribute((target(...))), take an argument and
index 61ff515..5f661ee 100644 (file)
@@ -908,7 +908,7 @@ avr_adjust_type_node (tree *node, machine_mode mode, int sat_p)
   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 55cf52f..821cce8 100644 (file)
@@ -6305,7 +6305,7 @@ mips_std_gimplify_va_arg_expr (tree valist, tree type, gimple_seq *pre_p,
   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 6f63116..2e2a02c 100644 (file)
@@ -1461,7 +1461,7 @@ msp430_gimplify_va_arg_expr (tree valist, tree type, gimple_seq *pre_p,
   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 401c295..c3757eb 100644 (file)
@@ -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 b1fce7d..67cc908 100644 (file)
@@ -751,7 +751,7 @@ build_var (tree fn_decl, tree type, int counter)
   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 ceff3ef..71f7eec 100644 (file)
@@ -804,7 +804,7 @@ build_vtable (tree class_type, tree name, tree vtable_type)
   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);
@@ -2040,7 +2040,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);
       if (may_alias)
        fixup_may_alias (variants);
     }
@@ -4490,7 +4490,7 @@ build_base_field (record_layout_info rli, tree binfo,
        {
          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;
@@ -6409,7 +6409,7 @@ layout_class_type (tree t, tree *virtuals_p)
            }
 
          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);
@@ -6544,7 +6544,7 @@ layout_class_type (tree t, tree *virtuals_p)
                      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 30a8c5a..95d7cf0 100644 (file)
@@ -2066,7 +2066,7 @@ duplicate_decls (tree newdecl, tree olddecl, bool newdecl_is_friend)
          if (TYPE_USER_ALIGN (tem))
            {
              if (TYPE_ALIGN (tem) > TYPE_ALIGN (newtype))
-               TYPE_ALIGN (newtype) = TYPE_ALIGN (tem);
+               SET_TYPE_ALIGN (newtype, TYPE_ALIGN (tem));
              TYPE_USER_ALIGN (newtype) = true;
            }
 
@@ -2498,7 +2498,7 @@ duplicate_decls (tree newdecl, tree olddecl, bool newdecl_is_friend)
   /* 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);
@@ -3927,7 +3927,7 @@ record_unknown_type (tree type, const char* name)
   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));
 }
@@ -4182,7 +4182,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);
@@ -7938,7 +7938,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))
@@ -13128,7 +13128,7 @@ copy_type_enum (tree dst, tree src)
        valign = MAX (valign, TYPE_ALIGN (t));
       else
        TYPE_USER_ALIGN (t) = TYPE_USER_ALIGN (src);
-      TYPE_ALIGN (t) = valign;
+      SET_TYPE_ALIGN (t, valign);
       TYPE_UNSIGNED (t) = TYPE_UNSIGNED (src);
     }
 }
index 7a5220c..9fa2142 100644 (file)
@@ -1011,7 +1011,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 6920fbb..547e672 100644 (file)
@@ -1867,7 +1867,7 @@ implicitly_declare_fn (special_function_kind kind, tree type,
       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 a98a5dc..e6ea2e8 100644 (file)
@@ -9880,7 +9880,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<T> */
   if (ANON_AGGR_TYPE_P (pattern))
@@ -13471,7 +13471,7 @@ tsubst (tree t, tree args, tsubst_flags_t complain, tree in_decl)
 
        if (TYPE_USER_ALIGN (t))
          {
-           TYPE_ALIGN (r) = TYPE_ALIGN (t);
+           SET_TYPE_ALIGN (r, TYPE_ALIGN (t));
            TYPE_USER_ALIGN (r) = 1;
          }
 
index 244c34d..43d5f15 100644 (file)
@@ -1603,7 +1603,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 5e8bb74..807ed82 100644 (file)
@@ -1075,7 +1075,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 2a1073f..cf1df8c 100644 (file)
@@ -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 6260f5e..b25ba3a 100644 (file)
@@ -7704,7 +7704,7 @@ expand_expr_addr_expr_1 (tree exp, rtx target, machine_mode tmode,
     {
       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 e39551c..432c83c 100644 (file)
@@ -436,7 +436,7 @@ build_common_decl (gfc_common_head *com, tree union_type, bool is_init)
       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
@@ -447,7 +447,7 @@ build_common_decl (gfc_common_head *com, tree union_type, bool is_init)
          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 125f45c..aefa96d 100644 (file)
@@ -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 831c84f..442fe56 100644 (file)
@@ -2279,7 +2279,7 @@ gfc_add_field_to_struct (tree context, tree name, tree type, tree **chain)
   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 4f27912..b78d097 100644 (file)
@@ -2925,7 +2925,7 @@ assign_parm_setup_block (struct assign_parm_data_all *all,
   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 29e9c0a..ed012cc 100644 (file)
@@ -377,7 +377,7 @@ copy_var_decl (tree var, tree name, tree type)
   DECL_ATTRIBUTES (copy) = DECL_ATTRIBUTES (var);
   if (DECL_USER_ALIGN (var))
     {
-      DECL_ALIGN (copy) = DECL_ALIGN (var);
+      SET_DECL_ALIGN (copy, DECL_ALIGN (var));
       DECL_USER_ALIGN (copy) = 1;
     }
 
index 2793bb6..1cb3242 100644 (file)
@@ -2687,7 +2687,7 @@ Gcc_backend::implicit_variable(const std::string& name, Btype* type,
     }
   if (alignment != 0)
     {
-      DECL_ALIGN(decl) = alignment * BITS_PER_UNIT;
+      SET_DECL_ALIGN(decl, alignment * BITS_PER_UNIT);
       DECL_USER_ALIGN(decl) = 1;
     }
 
index 1904987..b4708bc 100644 (file)
@@ -773,7 +773,7 @@ add_method_1 (tree this_class, int access_flags, tree name, tree function_type)
   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;
@@ -2791,7 +2791,7 @@ emit_register_classes_in_jcr_section (void)
   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 1214eae..d2e3db6 100644 (file)
@@ -305,7 +305,7 @@ build_java_array_type (tree element_type, HOST_WIDE_INT length)
                      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 8109507..4856457 100644 (file)
@@ -2115,7 +2115,7 @@ objc_build_struct (tree klass, tree fields, tree super_name)
        = 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 57a03df..024b57a 100644 (file)
@@ -1452,12 +1452,12 @@ install_var_field (tree var, bool by_ref, int mask, omp_context *ctx,
   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)
     {
@@ -1467,7 +1467,7 @@ install_var_field (tree var, bool by_ref, int mask, omp_context *ctx,
          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);
@@ -2160,7 +2160,7 @@ scan_sharing_clauses (tree clauses, omp_context *ctx,
                  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);
@@ -2805,18 +2805,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));
              }
          }
     }
@@ -18500,8 +18500,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;
@@ -18517,8 +18517,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 dd40ca0..8629984 100644 (file)
@@ -565,7 +565,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);
     }
@@ -658,7 +658,7 @@ layout_decl (tree decl, unsigned int known_align)
 #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
@@ -680,7 +680,7 @@ layout_decl (tree decl, unsigned int known_align)
                  && !(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;
                }
@@ -705,7 +705,7 @@ layout_decl (tree decl, unsigned int known_align)
         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))
        {
@@ -713,11 +713,11 @@ layout_decl (tree decl, unsigned int known_align)
             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
        }
 
@@ -727,7 +727,7 @@ layout_decl (tree decl, unsigned int known_align)
        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.  */
@@ -777,7 +777,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);
@@ -1558,10 +1558,10 @@ finalize_record_size (record_layout_info rli)
 
   /* 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
@@ -1718,15 +1718,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
@@ -1779,7 +1779,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);
        }
@@ -2073,7 +2073,7 @@ finish_builtin_struct (tree type, const char *name, tree fields,
 
   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);
     }
 
@@ -2184,7 +2184,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,
@@ -2196,7 +2196,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;
@@ -2315,7 +2315,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)
@@ -2587,13 +2587,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 3d3cc4f..343b38d 100644 (file)
@@ -2152,7 +2152,7 @@ increase_alignment_1 (symtab_node *n, void *v)
   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 a342277..6b4601b 100644 (file)
@@ -1856,7 +1856,7 @@ std_gimplify_va_arg_expr (tree valist, tree type, gimple_seq *pre_p,
   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 41c1a9b..0d48ff5 100644 (file)
@@ -1441,7 +1441,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;
@@ -1542,12 +1548,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 de49bf4..229a271 100644 (file)
@@ -192,7 +192,7 @@ insert_field_into_struct (tree type, tree field)
 
   /* 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_info *info, tree decl,
       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 *info)
       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 *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 *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 89556e1..c198c16 100644 (file)
@@ -2119,7 +2119,7 @@ fold_builtin_alloca_with_align (gimple *stmt)
   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 91c72eb..2ad2f92 100644 (file)
@@ -230,10 +230,10 @@ unpack_ts_decl_common_value_fields (struct bitpack_d *bp, tree expr)
   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)
     {
@@ -378,10 +378,10 @@ unpack_ts_type_common_value_fields (struct bitpack_d *bp, tree expr)
   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 4839efb..e69c678 100644 (file)
@@ -5149,7 +5149,7 @@ ensure_base_align (stmt_vec_info stmt_info, struct data_reference *dr)
        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 8dbaadd..e0a48cc 100644 (file)
@@ -1022,11 +1022,11 @@ make_node_stat (enum tree_code code MEM_STAT_DECL)
        {
          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)
@@ -1043,7 +1043,7 @@ make_node_stat (enum tree_code code MEM_STAT_DECL)
 
     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;
@@ -6643,7 +6643,7 @@ build_qualified_type (tree type, int type_quals)
              /* 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));
            }
        }
 
@@ -6682,7 +6682,7 @@ build_aligned_type (tree type, unsigned int align)
       return t;
 
   t = build_variant_type_copy (type);
-  TYPE_ALIGN (t) = align;
+  SET_TYPE_ALIGN (t, align);
 
   return t;
 }
@@ -8132,7 +8132,7 @@ build_range_type_1 (tree type, tree lowval, tree highval, bool shared)
   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)
@@ -10043,7 +10043,7 @@ build_atomic_base (tree type, unsigned int align)
   set_type_quals (t, TYPE_QUAL_ATOMIC);
 
   if (align)
-    TYPE_ALIGN (t) = align;
+    SET_TYPE_ALIGN (t, align);
 
   return t;
 }
@@ -10192,7 +10192,7 @@ build_common_tree_nodes (bool signed_char)
 
   /* 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 1967097..5cbce77 100644 (file)
@@ -915,10 +915,7 @@ extern void omp_clause_range_check_failed (const_tree, const char *, int,
    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++.  */
@@ -1864,8 +1861,15 @@ extern machine_mode element_mode (const_tree t);
 #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.  */
@@ -2305,8 +2309,16 @@ extern machine_mode element_mode (const_tree t);
 #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
@@ -2509,7 +2521,7 @@ extern void decl_value_expr_insert (tree, 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 9317273..d8bd985 100644 (file)
@@ -1053,7 +1053,7 @@ align_variable (tree decl, bool dont_output_data)
 
   /* 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
@@ -2187,8 +2187,8 @@ assemble_variable (tree decl, int top_level ATTRIBUTE_UNUSED,
       && 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));
@@ -3249,7 +3249,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);
@@ -3408,8 +3408,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 57fca7c..44d0d60 100644 (file)
@@ -553,8 +553,8 @@ plugin_finish_record_or_union (cc1_plugin::connection *,
     {
       // 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);