tree.h (TYPE_ALIGN, DECL_ALIGN): Return shifted amount.
* 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. * 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. From-SVN: r235172
This commit is contained in:
parent
91a47c39bf
commit
fe37c7afd1
|
@ -1,3 +1,59 @@
|
||||||
|
2016-04-18 Michael Matz <matz@suse.de>
|
||||||
|
|
||||||
|
* 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.
|
||||||
|
* 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.
|
||||||
|
|
||||||
2016-04-18 H.J. Lu <hongjiu.lu@intel.com>
|
2016-04-18 H.J. Lu <hongjiu.lu@intel.com>
|
||||||
|
|
||||||
PR target/70708
|
PR target/70708
|
||||||
|
|
|
@ -1,3 +1,19 @@
|
||||||
|
2016-04-18 Michael Matz <matz@suse.de>
|
||||||
|
|
||||||
|
* 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.
|
||||||
|
|
||||||
2016-04-18 Arnaud Charlet <charlet@adacore.com>
|
2016-04-18 Arnaud Charlet <charlet@adacore.com>
|
||||||
|
|
||||||
* einfo.adb (Overridden_Operation): assert that
|
* einfo.adb (Overridden_Operation): assert that
|
||||||
|
|
|
@ -1888,8 +1888,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
|
This means that bit-packed arrays are given "ceil" alignment for
|
||||||
their size by default, which may seem counter-intuitive but makes
|
their size by default, which may seem counter-intuitive but makes
|
||||||
it possible to overlay them on modular types easily. */
|
it possible to overlay them on modular types easily. */
|
||||||
TYPE_ALIGN (gnu_type)
|
SET_TYPE_ALIGN (gnu_type,
|
||||||
= align > 0 ? align : TYPE_ALIGN (gnu_field_type);
|
align > 0 ? align : TYPE_ALIGN (gnu_field_type));
|
||||||
|
|
||||||
/* Propagate the reverse storage order flag to the record type so
|
/* Propagate the reverse storage order flag to the record type so
|
||||||
that the required byte swapping is performed when retrieving the
|
that the required byte swapping is performed when retrieving the
|
||||||
|
@ -1953,7 +1953,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 (gnu_type) = TYPE_SIZE (gnu_field_type);
|
||||||
TYPE_SIZE_UNIT (gnu_type) = TYPE_SIZE_UNIT (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));
|
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);
|
relate_alias_sets (gnu_type, gnu_field_type, ALIAS_SET_COPY);
|
||||||
|
|
||||||
/* Don't declare the field as addressable since we won't be taking
|
/* Don't declare the field as addressable since we won't be taking
|
||||||
|
@ -2265,9 +2265,10 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
|
||||||
if (No (Packed_Array_Impl_Type (gnat_entity))
|
if (No (Packed_Array_Impl_Type (gnat_entity))
|
||||||
&& Known_Alignment (gnat_entity))
|
&& Known_Alignment (gnat_entity))
|
||||||
{
|
{
|
||||||
TYPE_ALIGN (tem)
|
SET_TYPE_ALIGN (tem,
|
||||||
= validate_alignment (Alignment (gnat_entity), gnat_entity,
|
validate_alignment (Alignment (gnat_entity),
|
||||||
TYPE_ALIGN (tem));
|
gnat_entity,
|
||||||
|
TYPE_ALIGN (tem)));
|
||||||
if (Present (Alignment_Clause (gnat_entity)))
|
if (Present (Alignment_Clause (gnat_entity)))
|
||||||
TYPE_USER_ALIGN (tem) = 1;
|
TYPE_USER_ALIGN (tem) = 1;
|
||||||
}
|
}
|
||||||
|
@ -2296,7 +2297,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
|
||||||
TYPE_POINTER_TO (gnu_type) = gnu_fat_type;
|
TYPE_POINTER_TO (gnu_type) = gnu_fat_type;
|
||||||
TYPE_REFERENCE_TO (gnu_type) = gnu_fat_type;
|
TYPE_REFERENCE_TO (gnu_type) = gnu_fat_type;
|
||||||
SET_TYPE_MODE (gnu_type, BLKmode);
|
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 the maximum size doesn't overflow, use it. */
|
||||||
if (gnu_max_size
|
if (gnu_max_size
|
||||||
|
@ -3035,11 +3036,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
|
/* Always set the alignment on the record type here so that it can
|
||||||
get the proper layout. */
|
get the proper layout. */
|
||||||
if (has_align)
|
if (has_align)
|
||||||
TYPE_ALIGN (gnu_type)
|
SET_TYPE_ALIGN (gnu_type,
|
||||||
= validate_alignment (Alignment (gnat_entity), gnat_entity, 0);
|
validate_alignment (Alignment (gnat_entity),
|
||||||
|
gnat_entity, 0));
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
TYPE_ALIGN (gnu_type) = 0;
|
SET_TYPE_ALIGN (gnu_type, 0);
|
||||||
|
|
||||||
/* If a type needs strict alignment, the minimum size will be the
|
/* If a type needs strict alignment, the minimum size will be the
|
||||||
type size instead of the RM size (see validate_size). Cap the
|
type size instead of the RM size (see validate_size). Cap the
|
||||||
|
@ -3138,7 +3140,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
|
||||||
be created with a component clause below, then we need
|
be created with a component clause below, then we need
|
||||||
to apply the same adjustment as in gnat_to_gnu_field. */
|
to apply the same adjustment as in gnat_to_gnu_field. */
|
||||||
if (has_rep && TYPE_ALIGN (gnu_type) < TYPE_ALIGN (gnu_parent))
|
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
|
/* Finally we fix up both kinds of twisted COMPONENT_REF we have
|
||||||
initially built. The discriminants must reference the fields
|
initially built. The discriminants must reference the fields
|
||||||
|
@ -4565,8 +4567,8 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
|
||||||
/* Set a default alignment to speed up accesses. But we
|
/* Set a default alignment to speed up accesses. But we
|
||||||
shouldn't increase the size of the structure too much,
|
shouldn't increase the size of the structure too much,
|
||||||
lest it doesn't fit in return registers anymore. */
|
lest it doesn't fit in return registers anymore. */
|
||||||
TYPE_ALIGN (gnu_return_type)
|
SET_TYPE_ALIGN (gnu_return_type,
|
||||||
= get_mode_alignment (ptr_mode);
|
get_mode_alignment (ptr_mode));
|
||||||
}
|
}
|
||||||
|
|
||||||
gnu_field
|
gnu_field
|
||||||
|
@ -4613,8 +4615,8 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
|
||||||
if (mode != BLKmode)
|
if (mode != BLKmode)
|
||||||
{
|
{
|
||||||
SET_TYPE_MODE (gnu_return_type, mode);
|
SET_TYPE_MODE (gnu_return_type, mode);
|
||||||
TYPE_ALIGN (gnu_return_type)
|
SET_TYPE_ALIGN (gnu_return_type,
|
||||||
= GET_MODE_ALIGNMENT (mode);
|
GET_MODE_ALIGNMENT (mode));
|
||||||
TYPE_SIZE (gnu_return_type)
|
TYPE_SIZE (gnu_return_type)
|
||||||
= bitsize_int (GET_MODE_BITSIZE (mode));
|
= bitsize_int (GET_MODE_BITSIZE (mode));
|
||||||
TYPE_SIZE_UNIT (gnu_return_type)
|
TYPE_SIZE_UNIT (gnu_return_type)
|
||||||
|
@ -6796,7 +6798,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);
|
const unsigned int type_align = TYPE_ALIGN (gnu_field_type);
|
||||||
|
|
||||||
if (TYPE_ALIGN (gnu_record_type) < type_align)
|
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,
|
/* If the position is not a multiple of the alignment of the type,
|
||||||
then error out and reset the position. */
|
then error out and reset the position. */
|
||||||
|
@ -7283,7 +7285,7 @@ components_to_record (tree gnu_record_type, Node_Id gnat_component_list,
|
||||||
= make_node (unchecked_union ? UNION_TYPE : QUAL_UNION_TYPE);
|
= make_node (unchecked_union ? UNION_TYPE : QUAL_UNION_TYPE);
|
||||||
|
|
||||||
TYPE_NAME (gnu_union_type) = gnu_union_name;
|
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_PACKED (gnu_union_type) = TYPE_PACKED (gnu_record_type);
|
||||||
TYPE_REVERSE_STORAGE_ORDER (gnu_union_type)
|
TYPE_REVERSE_STORAGE_ORDER (gnu_union_type)
|
||||||
= TYPE_REVERSE_STORAGE_ORDER (gnu_record_type);
|
= TYPE_REVERSE_STORAGE_ORDER (gnu_record_type);
|
||||||
|
@ -7336,7 +7338,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
|
/* Set the alignment of the inner type in case we need to make
|
||||||
inner objects into bitfields, but then clear it out so the
|
inner objects into bitfields, but then clear it out so the
|
||||||
record actually gets only the alignment required. */
|
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_PACKED (gnu_variant_type) = TYPE_PACKED (gnu_record_type);
|
||||||
TYPE_REVERSE_STORAGE_ORDER (gnu_variant_type)
|
TYPE_REVERSE_STORAGE_ORDER (gnu_variant_type)
|
||||||
= TYPE_REVERSE_STORAGE_ORDER (gnu_record_type);
|
= TYPE_REVERSE_STORAGE_ORDER (gnu_record_type);
|
||||||
|
@ -7568,9 +7570,9 @@ components_to_record (tree gnu_record_type, Node_Id gnat_component_list,
|
||||||
SET_DECL_OFFSET_ALIGN (gnu_field, BIGGEST_ALIGNMENT);
|
SET_DECL_OFFSET_ALIGN (gnu_field, BIGGEST_ALIGNMENT);
|
||||||
DECL_FIELD_BIT_OFFSET (gnu_field) = bitsize_zero_node;
|
DECL_FIELD_BIT_OFFSET (gnu_field) = bitsize_zero_node;
|
||||||
if (field_is_aliased (gnu_field))
|
if (field_is_aliased (gnu_field))
|
||||||
TYPE_ALIGN (gnu_record_type)
|
SET_TYPE_ALIGN (gnu_record_type,
|
||||||
= MAX (TYPE_ALIGN (gnu_record_type),
|
MAX (TYPE_ALIGN (gnu_record_type),
|
||||||
TYPE_ALIGN (TREE_TYPE (gnu_field)));
|
TYPE_ALIGN (TREE_TYPE (gnu_field))));
|
||||||
MOVE_FROM_FIELD_LIST_TO (gnu_zero_list);
|
MOVE_FROM_FIELD_LIST_TO (gnu_zero_list);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -7681,7 +7683,7 @@ components_to_record (tree gnu_record_type, Node_Id gnat_component_list,
|
||||||
gnu_field_list = chainon (gnu_field_list, gnu_variant_part);
|
gnu_field_list = chainon (gnu_field_list, gnu_variant_part);
|
||||||
|
|
||||||
if (cancel_alignment)
|
if (cancel_alignment)
|
||||||
TYPE_ALIGN (gnu_record_type) = 0;
|
SET_TYPE_ALIGN (gnu_record_type, 0);
|
||||||
|
|
||||||
TYPE_ARTIFICIAL (gnu_record_type) = artificial;
|
TYPE_ARTIFICIAL (gnu_record_type) = artificial;
|
||||||
|
|
||||||
|
@ -8794,7 +8796,7 @@ create_variant_part_from (tree old_variant_part,
|
||||||
SET_TYPE_ADA_SIZE (new_union_type,
|
SET_TYPE_ADA_SIZE (new_union_type,
|
||||||
size_binop (MINUS_EXPR, TYPE_ADA_SIZE (record_type),
|
size_binop (MINUS_EXPR, TYPE_ADA_SIZE (record_type),
|
||||||
first_bit));
|
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);
|
relate_alias_sets (new_union_type, old_union_type, ALIAS_SET_COPY);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -8891,7 +8893,7 @@ copy_and_substitute_in_size (tree new_type, tree old_type,
|
||||||
TYPE_SIZE (new_type) = TYPE_SIZE (old_type);
|
TYPE_SIZE (new_type) = TYPE_SIZE (old_type);
|
||||||
TYPE_SIZE_UNIT (new_type) = TYPE_SIZE_UNIT (old_type);
|
TYPE_SIZE_UNIT (new_type) = TYPE_SIZE_UNIT (old_type);
|
||||||
SET_TYPE_ADA_SIZE (new_type, TYPE_ADA_SIZE (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);
|
relate_alias_sets (new_type, old_type, ALIAS_SET_COPY);
|
||||||
|
|
||||||
if (CONTAINS_PLACEHOLDER_P (TYPE_SIZE (new_type)))
|
if (CONTAINS_PLACEHOLDER_P (TYPE_SIZE (new_type)))
|
||||||
|
@ -9034,7 +9036,7 @@ substitute_in_type (tree t, tree f, tree r)
|
||||||
return t;
|
return t;
|
||||||
|
|
||||||
nt = build_nonshared_array_type (component, domain);
|
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);
|
TYPE_USER_ALIGN (nt) = TYPE_USER_ALIGN (t);
|
||||||
SET_TYPE_MODE (nt, TYPE_MODE (t));
|
SET_TYPE_MODE (nt, TYPE_MODE (t));
|
||||||
TYPE_SIZE (nt) = SUBSTITUTE_IN_EXPR (TYPE_SIZE (t), f, r);
|
TYPE_SIZE (nt) = SUBSTITUTE_IN_EXPR (TYPE_SIZE (t), f, r);
|
||||||
|
|
|
@ -904,7 +904,7 @@ make_aligning_type (tree type, unsigned int align, tree size,
|
||||||
pos, 1, -1);
|
pos, 1, -1);
|
||||||
TYPE_FIELDS (record_type) = field;
|
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_USER_ALIGN (record_type) = 1;
|
||||||
|
|
||||||
TYPE_SIZE (record_type)
|
TYPE_SIZE (record_type)
|
||||||
|
@ -963,7 +963,7 @@ make_packable_type (tree type, bool in_record)
|
||||||
if (in_record && size <= MAX_FIXED_MODE_SIZE)
|
if (in_record && size <= MAX_FIXED_MODE_SIZE)
|
||||||
{
|
{
|
||||||
align = ceil_pow2 (size);
|
align = ceil_pow2 (size);
|
||||||
TYPE_ALIGN (new_type) = align;
|
SET_TYPE_ALIGN (new_type, align);
|
||||||
new_size = (size + align - 1) & -align;
|
new_size = (size + align - 1) & -align;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -983,7 +983,7 @@ make_packable_type (tree type, bool in_record)
|
||||||
return type;
|
return type;
|
||||||
|
|
||||||
align = new_size & -new_size;
|
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;
|
TYPE_USER_ALIGN (new_type) = 1;
|
||||||
|
@ -1295,7 +1295,7 @@ maybe_pad_type (tree type, tree size, unsigned int align,
|
||||||
else if (Present (gnat_entity))
|
else if (Present (gnat_entity))
|
||||||
TYPE_NAME (record) = create_concat_name (gnat_entity, "PAD");
|
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 (record) = size ? size : orig_size;
|
||||||
TYPE_SIZE_UNIT (record)
|
TYPE_SIZE_UNIT (record)
|
||||||
= convert (sizetype,
|
= convert (sizetype,
|
||||||
|
@ -1650,7 +1650,7 @@ finish_fat_pointer_type (tree record_type, tree field_list)
|
||||||
{
|
{
|
||||||
/* Make sure we can put it into a register. */
|
/* Make sure we can put it into a register. */
|
||||||
if (STRICT_ALIGNMENT)
|
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. */
|
/* Show what it really is. */
|
||||||
TYPE_FAT_POINTER_P (record_type) = 1;
|
TYPE_FAT_POINTER_P (record_type) = 1;
|
||||||
|
@ -1697,7 +1697,8 @@ finish_record_type (tree record_type, tree field_list, int rep_level,
|
||||||
that just means some initializations; otherwise, layout the record. */
|
that just means some initializations; otherwise, layout the record. */
|
||||||
if (rep_level > 0)
|
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)
|
if (!had_size_unit)
|
||||||
TYPE_SIZE_UNIT (record_type) = size_zero_node;
|
TYPE_SIZE_UNIT (record_type) = size_zero_node;
|
||||||
|
@ -1775,7 +1776,7 @@ finish_record_type (tree record_type, tree field_list, int rep_level,
|
||||||
maximum alignment, if any. */
|
maximum alignment, if any. */
|
||||||
if (TYPE_ALIGN (record_type) >= align)
|
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;
|
DECL_BIT_FIELD (field) = 0;
|
||||||
}
|
}
|
||||||
else if (!had_align
|
else if (!had_align
|
||||||
|
@ -1784,8 +1785,8 @@ finish_record_type (tree record_type, tree field_list, int rep_level,
|
||||||
&& (!TYPE_MAX_ALIGN (record_type)
|
&& (!TYPE_MAX_ALIGN (record_type)
|
||||||
|| TYPE_MAX_ALIGN (record_type) >= align))
|
|| TYPE_MAX_ALIGN (record_type) >= align))
|
||||||
{
|
{
|
||||||
TYPE_ALIGN (record_type) = align;
|
SET_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;
|
DECL_BIT_FIELD (field) = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1808,8 +1809,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 type must be as aligned as its most aligned field that is not
|
||||||
a bit-field. But this is already enforced by layout_type. */
|
a bit-field. But this is already enforced by layout_type. */
|
||||||
if (rep_level > 0 && !DECL_BIT_FIELD (field))
|
if (rep_level > 0 && !DECL_BIT_FIELD (field))
|
||||||
TYPE_ALIGN (record_type)
|
SET_TYPE_ALIGN (record_type,
|
||||||
= MAX (TYPE_ALIGN (record_type), DECL_ALIGN (field));
|
MAX (TYPE_ALIGN (record_type), DECL_ALIGN (field)));
|
||||||
|
|
||||||
switch (code)
|
switch (code)
|
||||||
{
|
{
|
||||||
|
@ -1980,7 +1981,7 @@ rest_of_record_type_compilation (tree record_type)
|
||||||
= concat_name (orig_name, TREE_CODE (record_type) == QUAL_UNION_TYPE
|
= concat_name (orig_name, TREE_CODE (record_type) == QUAL_UNION_TYPE
|
||||||
? "XVU" : "XVE");
|
? "XVU" : "XVE");
|
||||||
TYPE_NAME (new_record_type) = new_name;
|
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)
|
TYPE_STUB_DECL (new_record_type)
|
||||||
= create_type_stub_decl (new_name, new_record_type);
|
= create_type_stub_decl (new_name, new_record_type);
|
||||||
DECL_IGNORED_P (TYPE_STUB_DECL (new_record_type))
|
DECL_IGNORED_P (TYPE_STUB_DECL (new_record_type))
|
||||||
|
@ -2072,7 +2073,7 @@ rest_of_record_type_compilation (tree record_type)
|
||||||
if (align != 0 && TYPE_ALIGN (field_type) > align)
|
if (align != 0 && TYPE_ALIGN (field_type) > align)
|
||||||
{
|
{
|
||||||
field_type = copy_node (field_type);
|
field_type = copy_node (field_type);
|
||||||
TYPE_ALIGN (field_type) = align;
|
SET_TYPE_ALIGN (field_type, align);
|
||||||
}
|
}
|
||||||
var = true;
|
var = true;
|
||||||
}
|
}
|
||||||
|
@ -2620,7 +2621,7 @@ create_field_decl (tree name, tree type, tree record_type, tree size, tree pos,
|
||||||
|| (!pos
|
|| (!pos
|
||||||
&& AGGREGATE_TYPE_P (type)
|
&& AGGREGATE_TYPE_P (type)
|
||||||
&& aggregate_type_contains_array_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
|
/* 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.
|
compute a size to use, which may differ from the object's natural size.
|
||||||
|
@ -2667,9 +2668,9 @@ create_field_decl (tree name, tree type, tree record_type, tree size, tree pos,
|
||||||
{
|
{
|
||||||
if (TYPE_ALIGN (record_type) != 0
|
if (TYPE_ALIGN (record_type) != 0
|
||||||
&& TYPE_ALIGN (record_type) < TYPE_ALIGN (type))
|
&& 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
|
else
|
||||||
DECL_ALIGN (field_decl) = TYPE_ALIGN (type);
|
SET_DECL_ALIGN (field_decl, TYPE_ALIGN (type));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2685,10 +2686,10 @@ create_field_decl (tree name, tree type, tree record_type, tree size, tree pos,
|
||||||
: packed && TYPE_MODE (type) != BLKmode ? BITS_PER_UNIT : 0);
|
: packed && TYPE_MODE (type) != BLKmode ? BITS_PER_UNIT : 0);
|
||||||
|
|
||||||
if (bit_align > DECL_ALIGN (field_decl))
|
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))
|
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);
|
DECL_USER_ALIGN (field_decl) = TYPE_USER_ALIGN (type);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,8 @@
|
||||||
|
2016-04-18 Michael Matz <matz@suse.de>
|
||||||
|
|
||||||
|
* c-common.c (handle_aligned_attribute): Use SET_TYPE_ALIGN
|
||||||
|
and SET_DECL_ALIGN.
|
||||||
|
|
||||||
2016-04-17 Eric Botcazou <ebotcazou@adacore.com>
|
2016-04-17 Eric Botcazou <ebotcazou@adacore.com>
|
||||||
|
|
||||||
* c-ada-spec.c (get_underlying_decl): Return the typedef, if any.
|
* c-ada-spec.c (get_underlying_decl): Return the typedef, if any.
|
||||||
|
|
|
@ -7837,7 +7837,7 @@ handle_aligned_attribute (tree *node, tree ARG_UNUSED (name), tree args,
|
||||||
else
|
else
|
||||||
*type = build_variant_type_copy (*type);
|
*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;
|
TYPE_USER_ALIGN (*type) = 1;
|
||||||
}
|
}
|
||||||
else if (! VAR_OR_FUNCTION_DECL_P (decl)
|
else if (! VAR_OR_FUNCTION_DECL_P (decl)
|
||||||
|
@ -7871,7 +7871,7 @@ handle_aligned_attribute (tree *node, tree ARG_UNUSED (name), tree args,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
DECL_ALIGN (decl) = (1U << i) * BITS_PER_UNIT;
|
SET_DECL_ALIGN (decl, (1U << i) * BITS_PER_UNIT);
|
||||||
DECL_USER_ALIGN (decl) = 1;
|
DECL_USER_ALIGN (decl) = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,8 @@
|
||||||
|
2016-04-18 Michael Matz <matz@suse.de>
|
||||||
|
|
||||||
|
* c-decl.c (merge_decls): Use SET_DECL_ALIGN and SET_TYPE_ALIGN.
|
||||||
|
(grokdeclarator, parser_xref_tag, finish_enum): Use SET_TYPE_ALIGN.
|
||||||
|
|
||||||
2016-04-15 Marek Polacek <polacek@redhat.com>
|
2016-04-15 Marek Polacek <polacek@redhat.com>
|
||||||
|
|
||||||
PR c/70671
|
PR c/70671
|
||||||
|
|
|
@ -2369,7 +2369,7 @@ merge_decls (tree newdecl, tree olddecl, tree newtype, tree oldtype)
|
||||||
if (TYPE_USER_ALIGN (tem))
|
if (TYPE_USER_ALIGN (tem))
|
||||||
{
|
{
|
||||||
if (TYPE_ALIGN (tem) > TYPE_ALIGN (newtype))
|
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;
|
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);
|
DECL_MODE (newdecl) = DECL_MODE (olddecl);
|
||||||
if (DECL_ALIGN (olddecl) > DECL_ALIGN (newdecl))
|
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 (newdecl) |= DECL_USER_ALIGN (olddecl);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6763,7 +6763,7 @@ grokdeclarator (const struct c_declarator *declarator,
|
||||||
/* Apply _Alignas specifiers. */
|
/* Apply _Alignas specifiers. */
|
||||||
if (alignas_align)
|
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;
|
DECL_USER_ALIGN (decl) = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7205,7 +7205,7 @@ parser_xref_tag (location_t loc, enum tree_code code, tree name)
|
||||||
/* Give the type a default layout like unsigned int
|
/* Give the type a default layout like unsigned int
|
||||||
to avoid crashing if it does not get defined. */
|
to avoid crashing if it does not get defined. */
|
||||||
SET_TYPE_MODE (ref, TYPE_MODE (unsigned_type_node));
|
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_USER_ALIGN (ref) = 0;
|
||||||
TYPE_UNSIGNED (ref) = 1;
|
TYPE_UNSIGNED (ref) = 1;
|
||||||
TYPE_PRECISION (ref) = TYPE_PRECISION (unsigned_type_node);
|
TYPE_PRECISION (ref) = TYPE_PRECISION (unsigned_type_node);
|
||||||
|
@ -8101,7 +8101,7 @@ finish_enum (tree enumtype, tree values, tree attributes)
|
||||||
TYPE_MIN_VALUE (enumtype) = TYPE_MIN_VALUE (tem);
|
TYPE_MIN_VALUE (enumtype) = TYPE_MIN_VALUE (tem);
|
||||||
TYPE_MAX_VALUE (enumtype) = TYPE_MAX_VALUE (tem);
|
TYPE_MAX_VALUE (enumtype) = TYPE_MAX_VALUE (tem);
|
||||||
TYPE_UNSIGNED (enumtype) = TYPE_UNSIGNED (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_SIZE (enumtype) = 0;
|
||||||
TYPE_PRECISION (enumtype) = TYPE_PRECISION (tem);
|
TYPE_PRECISION (enumtype) = TYPE_PRECISION (tem);
|
||||||
|
|
||||||
|
@ -8163,7 +8163,7 @@ finish_enum (tree enumtype, tree values, tree attributes)
|
||||||
TYPE_SIZE_UNIT (tem) = TYPE_SIZE_UNIT (enumtype);
|
TYPE_SIZE_UNIT (tem) = TYPE_SIZE_UNIT (enumtype);
|
||||||
SET_TYPE_MODE (tem, TYPE_MODE (enumtype));
|
SET_TYPE_MODE (tem, TYPE_MODE (enumtype));
|
||||||
TYPE_PRECISION (tem) = TYPE_PRECISION (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_USER_ALIGN (tem) = TYPE_USER_ALIGN (enumtype);
|
||||||
TYPE_UNSIGNED (tem) = TYPE_UNSIGNED (enumtype);
|
TYPE_UNSIGNED (tem) = TYPE_UNSIGNED (enumtype);
|
||||||
TYPE_LANG_SPECIFIC (tem) = TYPE_LANG_SPECIFIC (enumtype);
|
TYPE_LANG_SPECIFIC (tem) = TYPE_LANG_SPECIFIC (enumtype);
|
||||||
|
|
|
@ -369,7 +369,7 @@ align_local_variable (tree decl)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
align = LOCAL_DECL_ALIGNMENT (decl);
|
align = LOCAL_DECL_ALIGNMENT (decl);
|
||||||
DECL_ALIGN (decl) = align;
|
SET_DECL_ALIGN (decl, align);
|
||||||
}
|
}
|
||||||
return align / BITS_PER_UNIT;
|
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
|
alignment here, but (at least) the i386 port does exactly this
|
||||||
via the MINIMUM_ALIGNMENT hook. */
|
via the MINIMUM_ALIGNMENT hook. */
|
||||||
|
|
||||||
DECL_ALIGN (decl) = align;
|
SET_DECL_ALIGN (decl, align);
|
||||||
DECL_USER_ALIGN (decl) = 0;
|
DECL_USER_ALIGN (decl) = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -29981,8 +29981,8 @@ arm_relayout_function (tree fndecl)
|
||||||
if (!callee_tree)
|
if (!callee_tree)
|
||||||
callee_tree = target_option_default_node;
|
callee_tree = target_option_default_node;
|
||||||
|
|
||||||
DECL_ALIGN (fndecl) =
|
struct cl_target_option *opts = TREE_TARGET_OPTION (callee_tree);
|
||||||
FUNCTION_BOUNDARY_P (TREE_TARGET_OPTION (callee_tree)->x_target_flags);
|
SET_DECL_ALIGN (fndecl, FUNCTION_BOUNDARY_P (opts->x_target_flags));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Inner function to process the attribute((target(...))), take an argument and
|
/* Inner function to process the attribute((target(...))), take an argument and
|
||||||
|
|
|
@ -911,7 +911,7 @@ avr_adjust_type_node (tree *node, machine_mode mode, int sat_p)
|
||||||
TYPE_IBIT (*node) = GET_MODE_IBIT (mode);
|
TYPE_IBIT (*node) = GET_MODE_IBIT (mode);
|
||||||
TYPE_FBIT (*node) = GET_MODE_FBIT (mode);
|
TYPE_FBIT (*node) = GET_MODE_FBIT (mode);
|
||||||
TYPE_PRECISION (*node) = GET_MODE_BITSIZE (mode);
|
TYPE_PRECISION (*node) = GET_MODE_BITSIZE (mode);
|
||||||
TYPE_ALIGN (*node) = 8;
|
SET_TYPE_ALIGN (*node, 8);
|
||||||
SET_TYPE_MODE (*node, mode);
|
SET_TYPE_MODE (*node, mode);
|
||||||
|
|
||||||
layout_type (*node);
|
layout_type (*node);
|
||||||
|
|
|
@ -6304,7 +6304,7 @@ mips_std_gimplify_va_arg_expr (tree valist, tree type, gimple_seq *pre_p,
|
||||||
if (boundary < TYPE_ALIGN (type))
|
if (boundary < TYPE_ALIGN (type))
|
||||||
{
|
{
|
||||||
type = build_variant_type_copy (type);
|
type = build_variant_type_copy (type);
|
||||||
TYPE_ALIGN (type) = boundary;
|
SET_TYPE_ALIGN (type, boundary);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Compute the rounded size of the type. */
|
/* Compute the rounded size of the type. */
|
||||||
|
|
|
@ -1461,7 +1461,7 @@ msp430_gimplify_va_arg_expr (tree valist, tree type, gimple_seq *pre_p,
|
||||||
if (boundary < TYPE_ALIGN (type))
|
if (boundary < TYPE_ALIGN (type))
|
||||||
{
|
{
|
||||||
type = build_variant_type_copy (type);
|
type = build_variant_type_copy (type);
|
||||||
TYPE_ALIGN (type) = boundary;
|
SET_TYPE_ALIGN (type, boundary);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Compute the rounded size of the type. */
|
/* Compute the rounded size of the type. */
|
||||||
|
|
|
@ -3915,11 +3915,11 @@ spu_build_builtin_va_list (void)
|
||||||
FIELD_DECL, get_identifier ("__skip"), ptr_type_node);
|
FIELD_DECL, get_identifier ("__skip"), ptr_type_node);
|
||||||
|
|
||||||
DECL_FIELD_CONTEXT (f_args) = record;
|
DECL_FIELD_CONTEXT (f_args) = record;
|
||||||
DECL_ALIGN (f_args) = 128;
|
SET_DECL_ALIGN (f_args, 128);
|
||||||
DECL_USER_ALIGN (f_args) = 1;
|
DECL_USER_ALIGN (f_args) = 1;
|
||||||
|
|
||||||
DECL_FIELD_CONTEXT (f_skip) = record;
|
DECL_FIELD_CONTEXT (f_skip) = record;
|
||||||
DECL_ALIGN (f_skip) = 128;
|
SET_DECL_ALIGN (f_skip, 128);
|
||||||
DECL_USER_ALIGN (f_skip) = 1;
|
DECL_USER_ALIGN (f_skip) = 1;
|
||||||
|
|
||||||
TYPE_STUB_DECL (record) = type_decl;
|
TYPE_STUB_DECL (record) = type_decl;
|
||||||
|
|
|
@ -751,7 +751,7 @@ build_var (tree fn_decl, tree type, int counter)
|
||||||
TREE_STATIC (var) = 1;
|
TREE_STATIC (var) = 1;
|
||||||
TREE_ADDRESSABLE (var) = 1;
|
TREE_ADDRESSABLE (var) = 1;
|
||||||
DECL_NONALIASED (var) = 1;
|
DECL_NONALIASED (var) = 1;
|
||||||
DECL_ALIGN (var) = TYPE_ALIGN (type);
|
SET_DECL_ALIGN (var, TYPE_ALIGN (type));
|
||||||
|
|
||||||
return var;
|
return var;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,22 @@
|
||||||
|
2016-04-18 Michael Matz <matz@suse.de>
|
||||||
|
|
||||||
|
* 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.
|
||||||
|
|
||||||
2016-04-18 Jason Merrill <jason@redhat.com>
|
2016-04-18 Jason Merrill <jason@redhat.com>
|
||||||
|
|
||||||
PR c++/70690
|
PR c++/70690
|
||||||
|
|
|
@ -801,7 +801,7 @@ build_vtable (tree class_type, tree name, tree vtable_type)
|
||||||
TREE_STATIC (decl) = 1;
|
TREE_STATIC (decl) = 1;
|
||||||
TREE_READONLY (decl) = 1;
|
TREE_READONLY (decl) = 1;
|
||||||
DECL_VIRTUAL_P (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_USER_ALIGN (decl) = true;
|
||||||
DECL_VTABLE_OR_VTT_P (decl) = 1;
|
DECL_VTABLE_OR_VTT_P (decl) = 1;
|
||||||
set_linkage_according_to_type (class_type, decl);
|
set_linkage_according_to_type (class_type, decl);
|
||||||
|
@ -2035,7 +2035,7 @@ fixup_attribute_variants (tree t)
|
||||||
valign = MAX (valign, TYPE_ALIGN (variants));
|
valign = MAX (valign, TYPE_ALIGN (variants));
|
||||||
else
|
else
|
||||||
TYPE_USER_ALIGN (variants) = user_align;
|
TYPE_USER_ALIGN (variants) = user_align;
|
||||||
TYPE_ALIGN (variants) = valign;
|
SET_TYPE_ALIGN (variants, valign);
|
||||||
if (may_alias)
|
if (may_alias)
|
||||||
fixup_may_alias (variants);
|
fixup_may_alias (variants);
|
||||||
}
|
}
|
||||||
|
@ -4484,7 +4484,7 @@ build_base_field (record_layout_info rli, tree binfo,
|
||||||
{
|
{
|
||||||
DECL_SIZE (decl) = CLASSTYPE_SIZE (basetype);
|
DECL_SIZE (decl) = CLASSTYPE_SIZE (basetype);
|
||||||
DECL_SIZE_UNIT (decl) = CLASSTYPE_SIZE_UNIT (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_USER_ALIGN (decl) = CLASSTYPE_USER_ALIGN (basetype);
|
||||||
DECL_MODE (decl) = TYPE_MODE (basetype);
|
DECL_MODE (decl) = TYPE_MODE (basetype);
|
||||||
DECL_FIELD_IS_BASE (decl) = 1;
|
DECL_FIELD_IS_BASE (decl) = 1;
|
||||||
|
@ -6404,7 +6404,7 @@ layout_class_type (tree t, tree *virtuals_p)
|
||||||
}
|
}
|
||||||
|
|
||||||
DECL_SIZE (field) = TYPE_SIZE (integer_type);
|
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);
|
DECL_USER_ALIGN (field) = TYPE_USER_ALIGN (integer_type);
|
||||||
layout_nonempty_base_or_field (rli, field, NULL_TREE,
|
layout_nonempty_base_or_field (rli, field, NULL_TREE,
|
||||||
empty_base_offsets);
|
empty_base_offsets);
|
||||||
|
@ -6539,7 +6539,7 @@ layout_class_type (tree t, tree *virtuals_p)
|
||||||
size_binop (MULT_EXPR,
|
size_binop (MULT_EXPR,
|
||||||
fold_convert (bitsizetype, eoc),
|
fold_convert (bitsizetype, eoc),
|
||||||
bitsize_int (BITS_PER_UNIT)));
|
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);
|
TYPE_USER_ALIGN (base_t) = TYPE_USER_ALIGN (t);
|
||||||
|
|
||||||
/* Copy the fields from T. */
|
/* Copy the fields from T. */
|
||||||
|
|
|
@ -2066,7 +2066,7 @@ duplicate_decls (tree newdecl, tree olddecl, bool newdecl_is_friend)
|
||||||
if (TYPE_USER_ALIGN (tem))
|
if (TYPE_USER_ALIGN (tem))
|
||||||
{
|
{
|
||||||
if (TYPE_ALIGN (tem) > TYPE_ALIGN (newtype))
|
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;
|
TYPE_USER_ALIGN (newtype) = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2490,7 +2490,7 @@ duplicate_decls (tree newdecl, tree olddecl, bool newdecl_is_friend)
|
||||||
/* Likewise for DECL_ALIGN, DECL_USER_ALIGN and DECL_PACKED. */
|
/* Likewise for DECL_ALIGN, DECL_USER_ALIGN and DECL_PACKED. */
|
||||||
if (DECL_ALIGN (olddecl) > DECL_ALIGN (newdecl))
|
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 (newdecl) |= DECL_USER_ALIGN (olddecl);
|
||||||
}
|
}
|
||||||
DECL_USER_ALIGN (olddecl) = DECL_USER_ALIGN (newdecl);
|
DECL_USER_ALIGN (olddecl) = DECL_USER_ALIGN (newdecl);
|
||||||
|
@ -3919,7 +3919,7 @@ record_unknown_type (tree type, const char* name)
|
||||||
DECL_IGNORED_P (decl) = 1;
|
DECL_IGNORED_P (decl) = 1;
|
||||||
TYPE_DECL_SUPPRESS_DEBUG (decl) = 1;
|
TYPE_DECL_SUPPRESS_DEBUG (decl) = 1;
|
||||||
TYPE_SIZE (type) = TYPE_SIZE (void_type_node);
|
TYPE_SIZE (type) = TYPE_SIZE (void_type_node);
|
||||||
TYPE_ALIGN (type) = 1;
|
SET_TYPE_ALIGN (type, 1);
|
||||||
TYPE_USER_ALIGN (type) = 0;
|
TYPE_USER_ALIGN (type) = 0;
|
||||||
SET_TYPE_MODE (type, TYPE_MODE (void_type_node));
|
SET_TYPE_MODE (type, TYPE_MODE (void_type_node));
|
||||||
}
|
}
|
||||||
|
@ -4174,7 +4174,7 @@ cxx_init_decl_processing (void)
|
||||||
TYPE_UNSIGNED (nullptr_type_node) = 1;
|
TYPE_UNSIGNED (nullptr_type_node) = 1;
|
||||||
TYPE_PRECISION (nullptr_type_node) = GET_MODE_BITSIZE (ptr_mode);
|
TYPE_PRECISION (nullptr_type_node) = GET_MODE_BITSIZE (ptr_mode);
|
||||||
if (abi_version_at_least (9))
|
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);
|
SET_TYPE_MODE (nullptr_type_node, ptr_mode);
|
||||||
record_builtin_type (RID_MAX, "decltype(nullptr)", nullptr_type_node);
|
record_builtin_type (RID_MAX, "decltype(nullptr)", nullptr_type_node);
|
||||||
nullptr_node = build_int_cst (nullptr_type_node, 0);
|
nullptr_node = build_int_cst (nullptr_type_node, 0);
|
||||||
|
@ -7924,7 +7924,7 @@ grokfndecl (tree ctype,
|
||||||
parms = parm;
|
parms = parm;
|
||||||
|
|
||||||
/* Allocate space to hold the vptr bit if needed. */
|
/* 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;
|
DECL_ARGUMENTS (decl) = parms;
|
||||||
for (t = parms; t; t = DECL_CHAIN (t))
|
for (t = parms; t; t = DECL_CHAIN (t))
|
||||||
|
@ -13115,7 +13115,7 @@ copy_type_enum (tree dst, tree src)
|
||||||
valign = MAX (valign, TYPE_ALIGN (t));
|
valign = MAX (valign, TYPE_ALIGN (t));
|
||||||
else
|
else
|
||||||
TYPE_USER_ALIGN (t) = TYPE_USER_ALIGN (src);
|
TYPE_USER_ALIGN (t) = TYPE_USER_ALIGN (src);
|
||||||
TYPE_ALIGN (t) = valign;
|
SET_TYPE_ALIGN (t, valign);
|
||||||
TYPE_UNSIGNED (t) = TYPE_UNSIGNED (src);
|
TYPE_UNSIGNED (t) = TYPE_UNSIGNED (src);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1006,7 +1006,7 @@ maybe_add_lambda_conv_op (tree type)
|
||||||
tree convfn = build_lang_decl (FUNCTION_DECL, name, fntype);
|
tree convfn = build_lang_decl (FUNCTION_DECL, name, fntype);
|
||||||
tree fn = convfn;
|
tree fn = convfn;
|
||||||
DECL_SOURCE_LOCATION (fn) = DECL_SOURCE_LOCATION (callop);
|
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);
|
SET_OVERLOADED_OPERATOR_CODE (fn, TYPE_EXPR);
|
||||||
grokclassfn (type, fn, NO_SPECIAL);
|
grokclassfn (type, fn, NO_SPECIAL);
|
||||||
set_linkage_according_to_type (type, fn);
|
set_linkage_according_to_type (type, fn);
|
||||||
|
|
|
@ -1865,7 +1865,7 @@ implicitly_declare_fn (special_function_kind kind, tree type,
|
||||||
SET_OVERLOADED_OPERATOR_CODE (fn, NOP_EXPR);
|
SET_OVERLOADED_OPERATOR_CODE (fn, NOP_EXPR);
|
||||||
}
|
}
|
||||||
|
|
||||||
DECL_ALIGN (fn) = MINIMUM_METHOD_BOUNDARY;
|
SET_DECL_ALIGN (fn, MINIMUM_METHOD_BOUNDARY);
|
||||||
|
|
||||||
/* Create the explicit arguments. */
|
/* Create the explicit arguments. */
|
||||||
if (rhs_parm_type)
|
if (rhs_parm_type)
|
||||||
|
|
|
@ -9856,7 +9856,7 @@ instantiate_class_template_1 (tree type)
|
||||||
DECL_SOURCE_LOCATION (typedecl);
|
DECL_SOURCE_LOCATION (typedecl);
|
||||||
|
|
||||||
TYPE_PACKED (type) = TYPE_PACKED (pattern);
|
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_USER_ALIGN (type) = TYPE_USER_ALIGN (pattern);
|
||||||
TYPE_FOR_JAVA (type) = TYPE_FOR_JAVA (pattern); /* For libjava's JArray<T> */
|
TYPE_FOR_JAVA (type) = TYPE_FOR_JAVA (pattern); /* For libjava's JArray<T> */
|
||||||
if (ANON_AGGR_TYPE_P (pattern))
|
if (ANON_AGGR_TYPE_P (pattern))
|
||||||
|
@ -13403,7 +13403,7 @@ tsubst (tree t, tree args, tsubst_flags_t complain, tree in_decl)
|
||||||
|
|
||||||
if (TYPE_USER_ALIGN (t))
|
if (TYPE_USER_ALIGN (t))
|
||||||
{
|
{
|
||||||
TYPE_ALIGN (r) = TYPE_ALIGN (t);
|
SET_TYPE_ALIGN (r, TYPE_ALIGN (t));
|
||||||
TYPE_USER_ALIGN (r) = 1;
|
TYPE_USER_ALIGN (r) = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1603,7 +1603,7 @@ emit_tinfo_decl (tree decl)
|
||||||
/* Avoid targets optionally bumping up the alignment to improve
|
/* Avoid targets optionally bumping up the alignment to improve
|
||||||
vector instruction accesses, tinfo are never accessed this way. */
|
vector instruction accesses, tinfo are never accessed this way. */
|
||||||
#ifdef DATA_ABI_ALIGNMENT
|
#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;
|
DECL_USER_ALIGN (decl) = true;
|
||||||
#endif
|
#endif
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -1074,7 +1074,7 @@ cp_build_qualified_type_real (tree type,
|
||||||
{
|
{
|
||||||
t = build_variant_type_copy (t);
|
t = build_variant_type_copy (t);
|
||||||
TYPE_NAME (t) = TYPE_NAME (type);
|
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);
|
TYPE_USER_ALIGN (t) = TYPE_USER_ALIGN (type);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -300,7 +300,7 @@ init_eh (void)
|
||||||
#ifdef DONT_USE_BUILTIN_SETJMP
|
#ifdef DONT_USE_BUILTIN_SETJMP
|
||||||
/* We don't know what the alignment requirements of the
|
/* We don't know what the alignment requirements of the
|
||||||
runtime's jmp_buf has. Overestimate. */
|
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;
|
DECL_USER_ALIGN (f_jbuf) = 1;
|
||||||
#endif
|
#endif
|
||||||
DECL_FIELD_CONTEXT (f_jbuf) = sjlj_fc_type_node;
|
DECL_FIELD_CONTEXT (f_jbuf) = sjlj_fc_type_node;
|
||||||
|
|
|
@ -7712,7 +7712,7 @@ expand_expr_addr_expr_1 (tree exp, rtx target, machine_mode tmode,
|
||||||
{
|
{
|
||||||
inner = copy_node (inner);
|
inner = copy_node (inner);
|
||||||
TREE_TYPE (inner) = copy_node (TREE_TYPE (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;
|
TYPE_USER_ALIGN (TREE_TYPE (inner)) = 1;
|
||||||
}
|
}
|
||||||
result = expand_expr_addr_expr_1 (inner, subtarget, tmode, modifier, as);
|
result = expand_expr_addr_expr_1 (inner, subtarget, tmode, modifier, as);
|
||||||
|
|
|
@ -1,3 +1,9 @@
|
||||||
|
2016-04-18 Michael Matz <matz@suse.de>
|
||||||
|
|
||||||
|
* 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.
|
||||||
|
|
||||||
2016-04-13 Dominique d'Humieres <dominiq@lps.ens.fr>
|
2016-04-13 Dominique d'Humieres <dominiq@lps.ens.fr>
|
||||||
|
|
||||||
PR fortran/67039
|
PR fortran/67039
|
||||||
|
|
|
@ -438,7 +438,7 @@ build_common_decl (gfc_common_head *com, tree union_type, bool is_init)
|
||||||
TREE_STATIC (decl) = 1;
|
TREE_STATIC (decl) = 1;
|
||||||
DECL_IGNORED_P (decl) = 1;
|
DECL_IGNORED_P (decl) = 1;
|
||||||
if (!com->is_bind_c)
|
if (!com->is_bind_c)
|
||||||
DECL_ALIGN (decl) = BIGGEST_ALIGNMENT;
|
SET_DECL_ALIGN (decl, BIGGEST_ALIGNMENT);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Do not set the alignment for bind(c) common blocks to
|
/* Do not set the alignment for bind(c) common blocks to
|
||||||
|
@ -449,7 +449,7 @@ build_common_decl (gfc_common_head *com, tree union_type, bool is_init)
|
||||||
tree field = NULL_TREE;
|
tree field = NULL_TREE;
|
||||||
field = TYPE_FIELDS (TREE_TYPE (decl));
|
field = TYPE_FIELDS (TREE_TYPE (decl));
|
||||||
if (DECL_CHAIN (field) == NULL_TREE)
|
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;
|
DECL_USER_ALIGN (decl) = 0;
|
||||||
GFC_DECL_COMMON_OR_EQUIV (decl) = 1;
|
GFC_DECL_COMMON_OR_EQUIV (decl) = 1;
|
||||||
|
|
|
@ -309,8 +309,8 @@ gfc_build_io_library_fndecls (void)
|
||||||
alignment that is at least as large as the needed alignment for those
|
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
|
types. See the st_parameter_dt structure in libgfortran/io/io.h for
|
||||||
what really goes into this space. */
|
what really goes into this space. */
|
||||||
TYPE_ALIGN (types[IOPARM_type_pad]) = MAX (TYPE_ALIGN (pchar_type_node),
|
SET_TYPE_ALIGN (types[IOPARM_type_pad], MAX (TYPE_ALIGN (pchar_type_node),
|
||||||
TYPE_ALIGN (gfc_get_int_type (gfc_intio_kind)));
|
TYPE_ALIGN (gfc_get_int_type (gfc_intio_kind))));
|
||||||
|
|
||||||
for (ptype = IOPARM_ptype_common; ptype < IOPARM_ptype_num; ptype++)
|
for (ptype = IOPARM_ptype_common; ptype < IOPARM_ptype_num; ptype++)
|
||||||
gfc_build_st_parameter ((enum ioparam_type) ptype, types);
|
gfc_build_st_parameter ((enum ioparam_type) ptype, types);
|
||||||
|
|
|
@ -2275,7 +2275,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);
|
tree decl = gfc_add_field_to_struct_1 (context, name, type, chain);
|
||||||
|
|
||||||
DECL_INITIAL (decl) = 0;
|
DECL_INITIAL (decl) = 0;
|
||||||
DECL_ALIGN (decl) = 0;
|
SET_DECL_ALIGN (decl, 0);
|
||||||
DECL_USER_ALIGN (decl) = 0;
|
DECL_USER_ALIGN (decl) = 0;
|
||||||
|
|
||||||
return decl;
|
return decl;
|
||||||
|
|
|
@ -2925,7 +2925,7 @@ assign_parm_setup_block (struct assign_parm_data_all *all,
|
||||||
size_stored = CEIL_ROUND (size, UNITS_PER_WORD);
|
size_stored = CEIL_ROUND (size, UNITS_PER_WORD);
|
||||||
if (stack_parm == 0)
|
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,
|
stack_parm = assign_stack_local (BLKmode, size_stored,
|
||||||
DECL_ALIGN (parm));
|
DECL_ALIGN (parm));
|
||||||
if (GET_MODE_SIZE (GET_MODE (entry_parm)) == size)
|
if (GET_MODE_SIZE (GET_MODE (entry_parm)) == size)
|
||||||
|
|
|
@ -377,7 +377,7 @@ copy_var_decl (tree var, tree name, tree type)
|
||||||
DECL_ATTRIBUTES (copy) = DECL_ATTRIBUTES (var);
|
DECL_ATTRIBUTES (copy) = DECL_ATTRIBUTES (var);
|
||||||
if (DECL_USER_ALIGN (var))
|
if (DECL_USER_ALIGN (var))
|
||||||
{
|
{
|
||||||
DECL_ALIGN (copy) = DECL_ALIGN (var);
|
SET_DECL_ALIGN (copy, DECL_ALIGN (var));
|
||||||
DECL_USER_ALIGN (copy) = 1;
|
DECL_USER_ALIGN (copy) = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
|
2016-04-18 Michael Matz <matz@suse.de>
|
||||||
|
|
||||||
|
* go-gcc.cc (Gcc_backend::implicit_variable): Use SET_DECL_ALIGN.
|
||||||
|
|
||||||
2016-02-12 Jakub Jelinek <jakub@redhat.com>
|
2016-02-12 Jakub Jelinek <jakub@redhat.com>
|
||||||
|
|
||||||
* gofrontend/lex.cc: Spelling fixes - behaviour -> behavior and
|
* gofrontend/lex.cc: Spelling fixes - behaviour -> behavior and
|
||||||
|
|
|
@ -2687,7 +2687,7 @@ Gcc_backend::implicit_variable(const std::string& name, Btype* type,
|
||||||
}
|
}
|
||||||
if (alignment != 0)
|
if (alignment != 0)
|
||||||
{
|
{
|
||||||
DECL_ALIGN(decl) = alignment * BITS_PER_UNIT;
|
SET_DECL_ALIGN(decl, alignment * BITS_PER_UNIT);
|
||||||
DECL_USER_ALIGN(decl) = 1;
|
DECL_USER_ALIGN(decl) = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,10 @@
|
||||||
|
2016-04-18 Michael Matz <matz@suse.de>
|
||||||
|
|
||||||
|
* 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.
|
||||||
|
|
||||||
2016-01-04 Jakub Jelinek <jakub@redhat.com>
|
2016-01-04 Jakub Jelinek <jakub@redhat.com>
|
||||||
|
|
||||||
Update copyright years.
|
Update copyright years.
|
||||||
|
|
|
@ -773,7 +773,7 @@ add_method_1 (tree this_class, int access_flags, tree name, tree function_type)
|
||||||
TYPE_METHODS (this_class) = fndecl;
|
TYPE_METHODS (this_class) = fndecl;
|
||||||
|
|
||||||
if (!(access_flags & ACC_STATIC))
|
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
|
/* Notice that this is a finalizer and update the class type
|
||||||
accordingly. This is used to optimize instance allocation. */
|
accordingly. This is used to optimize instance allocation. */
|
||||||
|
@ -2210,7 +2210,7 @@ make_class_data (tree type)
|
||||||
|
|
||||||
/* Hash synchronization requires at least 64-bit alignment. */
|
/* Hash synchronization requires at least 64-bit alignment. */
|
||||||
if (flag_hash_synchronization && POINTER_SIZE < 64)
|
if (flag_hash_synchronization && POINTER_SIZE < 64)
|
||||||
DECL_ALIGN (decl) = 64;
|
SET_DECL_ALIGN (decl, 64);
|
||||||
|
|
||||||
if (flag_indirect_classes)
|
if (flag_indirect_classes)
|
||||||
{
|
{
|
||||||
|
@ -2790,7 +2790,7 @@ emit_register_classes_in_jcr_section (void)
|
||||||
cdecl = build_decl (UNKNOWN_LOCATION,
|
cdecl = build_decl (UNKNOWN_LOCATION,
|
||||||
VAR_DECL, get_identifier ("_Jv_JCR_SECTION_data"),
|
VAR_DECL, get_identifier ("_Jv_JCR_SECTION_data"),
|
||||||
class_array_type);
|
class_array_type);
|
||||||
DECL_ALIGN (cdecl) = POINTER_SIZE;
|
SET_DECL_ALIGN (cdecl, POINTER_SIZE);
|
||||||
DECL_USER_ALIGN (cdecl) = 1;
|
DECL_USER_ALIGN (cdecl) = 1;
|
||||||
DECL_INITIAL (cdecl) = build_constructor (class_array_type, init);
|
DECL_INITIAL (cdecl) = build_constructor (class_array_type, init);
|
||||||
TREE_CONSTANT (DECL_INITIAL (cdecl)) = 1;
|
TREE_CONSTANT (DECL_INITIAL (cdecl)) = 1;
|
||||||
|
|
|
@ -305,7 +305,7 @@ build_java_array_type (tree element_type, HOST_WIDE_INT length)
|
||||||
FIELD_DECL, get_identifier ("data"), atype);
|
FIELD_DECL, get_identifier ("data"), atype);
|
||||||
DECL_CONTEXT (arfld) = t;
|
DECL_CONTEXT (arfld) = t;
|
||||||
DECL_CHAIN (fld) = arfld;
|
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.
|
/* 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
|
* This is called by the parser, and it is a bad idea to do load_class
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
|
2016-04-18 Michael Matz <matz@suse.de>
|
||||||
|
|
||||||
|
* objc-act.c (objc_build_struct): Use SET_DECL_ALIGN.
|
||||||
|
|
||||||
2016-02-12 Jakub Jelinek <jakub@redhat.com>
|
2016-02-12 Jakub Jelinek <jakub@redhat.com>
|
||||||
|
|
||||||
* objc-act.c: Spelling fixes - behaviour -> behavior and
|
* objc-act.c: Spelling fixes - behaviour -> behavior and
|
||||||
|
|
|
@ -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_binop (FLOOR_DIV_EXPR, convert (sizetype, DECL_SIZE (base)),
|
||||||
size_int (BITS_PER_UNIT));
|
size_int (BITS_PER_UNIT));
|
||||||
DECL_ARTIFICIAL (base) = 1;
|
DECL_ARTIFICIAL (base) = 1;
|
||||||
DECL_ALIGN (base) = 1;
|
SET_DECL_ALIGN (base, 1);
|
||||||
DECL_FIELD_CONTEXT (base) = s;
|
DECL_FIELD_CONTEXT (base) = s;
|
||||||
#ifdef OBJCPLUS
|
#ifdef OBJCPLUS
|
||||||
DECL_FIELD_IS_BASE (base) = 1;
|
DECL_FIELD_IS_BASE (base) = 1;
|
||||||
|
|
|
@ -1445,12 +1445,12 @@ install_var_field (tree var, bool by_ref, int mask, omp_context *ctx,
|
||||||
DECL_ABSTRACT_ORIGIN (field) = var;
|
DECL_ABSTRACT_ORIGIN (field) = var;
|
||||||
if (type == TREE_TYPE (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);
|
DECL_USER_ALIGN (field) = DECL_USER_ALIGN (var);
|
||||||
TREE_THIS_VOLATILE (field) = TREE_THIS_VOLATILE (var);
|
TREE_THIS_VOLATILE (field) = TREE_THIS_VOLATILE (var);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
DECL_ALIGN (field) = TYPE_ALIGN (type);
|
SET_DECL_ALIGN (field, TYPE_ALIGN (type));
|
||||||
|
|
||||||
if ((mask & 3) == 3)
|
if ((mask & 3) == 3)
|
||||||
{
|
{
|
||||||
|
@ -1460,7 +1460,7 @@ install_var_field (tree var, bool by_ref, int mask, omp_context *ctx,
|
||||||
sfield = build_decl (DECL_SOURCE_LOCATION (var),
|
sfield = build_decl (DECL_SOURCE_LOCATION (var),
|
||||||
FIELD_DECL, DECL_NAME (var), type);
|
FIELD_DECL, DECL_NAME (var), type);
|
||||||
DECL_ABSTRACT_ORIGIN (sfield) = var;
|
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);
|
DECL_USER_ALIGN (sfield) = DECL_USER_ALIGN (field);
|
||||||
TREE_THIS_VOLATILE (sfield) = TREE_THIS_VOLATILE (field);
|
TREE_THIS_VOLATILE (sfield) = TREE_THIS_VOLATILE (field);
|
||||||
insert_field_into_struct (ctx->srecord_type, sfield);
|
insert_field_into_struct (ctx->srecord_type, sfield);
|
||||||
|
@ -2153,7 +2153,7 @@ scan_sharing_clauses (tree clauses, omp_context *ctx,
|
||||||
tree field
|
tree field
|
||||||
= build_decl (OMP_CLAUSE_LOCATION (c),
|
= build_decl (OMP_CLAUSE_LOCATION (c),
|
||||||
FIELD_DECL, NULL_TREE, ptr_type_node);
|
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);
|
insert_field_into_struct (ctx->record_type, field);
|
||||||
splay_tree_insert (ctx->field_map, (splay_tree_key) decl,
|
splay_tree_insert (ctx->field_map, (splay_tree_key) decl,
|
||||||
(splay_tree_value) field);
|
(splay_tree_value) field);
|
||||||
|
@ -2804,18 +2804,18 @@ finish_taskreg_scan (omp_context *ctx)
|
||||||
TREE_TYPE (field) = build_pointer_type (TREE_TYPE (decl));
|
TREE_TYPE (field) = build_pointer_type (TREE_TYPE (decl));
|
||||||
TREE_THIS_VOLATILE (field) = 0;
|
TREE_THIS_VOLATILE (field) = 0;
|
||||||
DECL_USER_ALIGN (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))
|
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)
|
if (ctx->srecord_type)
|
||||||
{
|
{
|
||||||
tree sfield = lookup_sfield (decl, ctx);
|
tree sfield = lookup_sfield (decl, ctx);
|
||||||
TREE_TYPE (sfield) = TREE_TYPE (field);
|
TREE_TYPE (sfield) = TREE_TYPE (field);
|
||||||
TREE_THIS_VOLATILE (sfield) = 0;
|
TREE_THIS_VOLATILE (sfield) = 0;
|
||||||
DECL_USER_ALIGN (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))
|
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));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -18486,8 +18486,8 @@ omp_finish_file (void)
|
||||||
num_vars * 2);
|
num_vars * 2);
|
||||||
tree funcs_decl_type = build_array_type_nelts (pointer_sized_int_node,
|
tree funcs_decl_type = build_array_type_nelts (pointer_sized_int_node,
|
||||||
num_funcs);
|
num_funcs);
|
||||||
TYPE_ALIGN (vars_decl_type) = TYPE_ALIGN (pointer_sized_int_node);
|
SET_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 (funcs_decl_type, TYPE_ALIGN (pointer_sized_int_node));
|
||||||
tree ctor_v = build_constructor (vars_decl_type, v_v);
|
tree ctor_v = build_constructor (vars_decl_type, v_v);
|
||||||
tree ctor_f = build_constructor (funcs_decl_type, v_f);
|
tree ctor_f = build_constructor (funcs_decl_type, v_f);
|
||||||
TREE_CONSTANT (ctor_v) = TREE_CONSTANT (ctor_f) = 1;
|
TREE_CONSTANT (ctor_v) = TREE_CONSTANT (ctor_f) = 1;
|
||||||
|
@ -18503,8 +18503,8 @@ omp_finish_file (void)
|
||||||
otherwise a joint table in a binary will contain padding between
|
otherwise a joint table in a binary will contain padding between
|
||||||
tables from multiple object files. */
|
tables from multiple object files. */
|
||||||
DECL_USER_ALIGN (funcs_decl) = DECL_USER_ALIGN (vars_decl) = 1;
|
DECL_USER_ALIGN (funcs_decl) = DECL_USER_ALIGN (vars_decl) = 1;
|
||||||
DECL_ALIGN (funcs_decl) = TYPE_ALIGN (funcs_decl_type);
|
SET_DECL_ALIGN (funcs_decl, TYPE_ALIGN (funcs_decl_type));
|
||||||
DECL_ALIGN (vars_decl) = TYPE_ALIGN (vars_decl_type);
|
SET_DECL_ALIGN (vars_decl, TYPE_ALIGN (vars_decl_type));
|
||||||
DECL_INITIAL (funcs_decl) = ctor_f;
|
DECL_INITIAL (funcs_decl) = ctor_f;
|
||||||
DECL_INITIAL (vars_decl) = ctor_v;
|
DECL_INITIAL (vars_decl) = ctor_v;
|
||||||
set_decl_section_name (funcs_decl, OFFLOAD_FUNC_TABLE_SECTION_NAME);
|
set_decl_section_name (funcs_decl, OFFLOAD_FUNC_TABLE_SECTION_NAME);
|
||||||
|
|
|
@ -579,7 +579,7 @@ do_type_align (tree type, tree decl)
|
||||||
{
|
{
|
||||||
if (TYPE_ALIGN (type) > DECL_ALIGN (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)
|
if (TREE_CODE (decl) == FIELD_DECL)
|
||||||
DECL_USER_ALIGN (decl) = TYPE_USER_ALIGN (type);
|
DECL_USER_ALIGN (decl) = TYPE_USER_ALIGN (type);
|
||||||
}
|
}
|
||||||
|
@ -672,7 +672,7 @@ layout_decl (tree decl, unsigned int known_align)
|
||||||
#ifdef EMPTY_FIELD_BOUNDARY
|
#ifdef EMPTY_FIELD_BOUNDARY
|
||||||
if (EMPTY_FIELD_BOUNDARY > DECL_ALIGN (decl))
|
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;
|
DECL_USER_ALIGN (decl) = 0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -694,7 +694,7 @@ layout_decl (tree decl, unsigned int known_align)
|
||||||
&& !(xalign > BITS_PER_UNIT && DECL_PACKED (decl))
|
&& !(xalign > BITS_PER_UNIT && DECL_PACKED (decl))
|
||||||
&& (known_align == 0 || known_align >= xalign))
|
&& (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_MODE (decl) = xmode;
|
||||||
DECL_BIT_FIELD (decl) = 0;
|
DECL_BIT_FIELD (decl) = 0;
|
||||||
}
|
}
|
||||||
|
@ -719,7 +719,7 @@ layout_decl (tree decl, unsigned int known_align)
|
||||||
DECL_USER_ALIGN, so we need to check old_user_align instead. */
|
DECL_USER_ALIGN, so we need to check old_user_align instead. */
|
||||||
if (packed_p
|
if (packed_p
|
||||||
&& !old_user_align)
|
&& !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))
|
if (! packed_p && ! DECL_USER_ALIGN (decl))
|
||||||
{
|
{
|
||||||
|
@ -727,11 +727,11 @@ layout_decl (tree decl, unsigned int known_align)
|
||||||
to a lower boundary than alignment of variables unless
|
to a lower boundary than alignment of variables unless
|
||||||
it was overridden by attribute aligned. */
|
it was overridden by attribute aligned. */
|
||||||
#ifdef BIGGEST_FIELD_ALIGNMENT
|
#ifdef BIGGEST_FIELD_ALIGNMENT
|
||||||
DECL_ALIGN (decl)
|
SET_DECL_ALIGN (decl, MIN (DECL_ALIGN (decl),
|
||||||
= MIN (DECL_ALIGN (decl), (unsigned) BIGGEST_FIELD_ALIGNMENT);
|
(unsigned) BIGGEST_FIELD_ALIGNMENT));
|
||||||
#endif
|
#endif
|
||||||
#ifdef ADJUST_FIELD_ALIGN
|
#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
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -741,7 +741,7 @@ layout_decl (tree decl, unsigned int known_align)
|
||||||
mfa = maximum_field_alignment;
|
mfa = maximum_field_alignment;
|
||||||
/* Should this be controlled by DECL_USER_ALIGN, too? */
|
/* Should this be controlled by DECL_USER_ALIGN, too? */
|
||||||
if (mfa != 0)
|
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. */
|
/* Evaluate nonconstant size only once, either now or as soon as safe. */
|
||||||
|
@ -791,7 +791,7 @@ relayout_decl (tree decl)
|
||||||
DECL_SIZE (decl) = DECL_SIZE_UNIT (decl) = 0;
|
DECL_SIZE (decl) = DECL_SIZE_UNIT (decl) = 0;
|
||||||
DECL_MODE (decl) = VOIDmode;
|
DECL_MODE (decl) = VOIDmode;
|
||||||
if (!DECL_USER_ALIGN (decl))
|
if (!DECL_USER_ALIGN (decl))
|
||||||
DECL_ALIGN (decl) = 0;
|
SET_DECL_ALIGN (decl, 0);
|
||||||
SET_DECL_RTL (decl, 0);
|
SET_DECL_RTL (decl, 0);
|
||||||
|
|
||||||
layout_decl (decl, 0);
|
layout_decl (decl, 0);
|
||||||
|
@ -1572,10 +1572,10 @@ finalize_record_size (record_layout_info rli)
|
||||||
|
|
||||||
/* Determine the desired alignment. */
|
/* Determine the desired alignment. */
|
||||||
#ifdef ROUND_TYPE_ALIGN
|
#ifdef ROUND_TYPE_ALIGN
|
||||||
TYPE_ALIGN (rli->t) = ROUND_TYPE_ALIGN (rli->t, TYPE_ALIGN (rli->t),
|
SET_TYPE_ALIGN (rli->t, ROUND_TYPE_ALIGN (rli->t, TYPE_ALIGN (rli->t),
|
||||||
rli->record_align);
|
rli->record_align));
|
||||||
#else
|
#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
|
#endif
|
||||||
|
|
||||||
/* Compute the size so far. Be sure to allow for extra bits in the
|
/* Compute the size so far. Be sure to allow for extra bits in the
|
||||||
|
@ -1732,15 +1732,15 @@ finalize_type_size (tree type)
|
||||||
alignment of one of the fields. */
|
alignment of one of the fields. */
|
||||||
if (mode_align >= TYPE_ALIGN (type))
|
if (mode_align >= TYPE_ALIGN (type))
|
||||||
{
|
{
|
||||||
TYPE_ALIGN (type) = mode_align;
|
SET_TYPE_ALIGN (type, mode_align);
|
||||||
TYPE_USER_ALIGN (type) = 0;
|
TYPE_USER_ALIGN (type) = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Do machine-dependent extra alignment. */
|
/* Do machine-dependent extra alignment. */
|
||||||
#ifdef ROUND_TYPE_ALIGN
|
#ifdef ROUND_TYPE_ALIGN
|
||||||
TYPE_ALIGN (type)
|
SET_TYPE_ALIGN (type,
|
||||||
= ROUND_TYPE_ALIGN (type, TYPE_ALIGN (type), BITS_PER_UNIT);
|
ROUND_TYPE_ALIGN (type, TYPE_ALIGN (type), BITS_PER_UNIT));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* If we failed to find a simple way to calculate the unit size
|
/* If we failed to find a simple way to calculate the unit size
|
||||||
|
@ -1793,7 +1793,7 @@ finalize_type_size (tree type)
|
||||||
valign = MAX (valign, TYPE_ALIGN (variant));
|
valign = MAX (valign, TYPE_ALIGN (variant));
|
||||||
else
|
else
|
||||||
TYPE_USER_ALIGN (variant) = user_align;
|
TYPE_USER_ALIGN (variant) = user_align;
|
||||||
TYPE_ALIGN (variant) = valign;
|
SET_TYPE_ALIGN (variant, valign);
|
||||||
TYPE_PRECISION (variant) = precision;
|
TYPE_PRECISION (variant) = precision;
|
||||||
SET_TYPE_MODE (variant, mode);
|
SET_TYPE_MODE (variant, mode);
|
||||||
}
|
}
|
||||||
|
@ -2087,7 +2087,7 @@ finish_builtin_struct (tree type, const char *name, tree fields,
|
||||||
|
|
||||||
if (align_type)
|
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);
|
TYPE_USER_ALIGN (type) = TYPE_USER_ALIGN (align_type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2200,7 +2200,7 @@ layout_type (tree type)
|
||||||
Instead, query a target hook, defaulting to natural alignment.
|
Instead, query a target hook, defaulting to natural alignment.
|
||||||
This prevents ABI changes depending on whether or not native
|
This prevents ABI changes depending on whether or not native
|
||||||
vector modes are supported. */
|
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
|
/* However, if the underlying mode requires a bigger alignment than
|
||||||
what the target hook provides, we cannot use the mode. For now,
|
what the target hook provides, we cannot use the mode. For now,
|
||||||
|
@ -2212,7 +2212,7 @@ layout_type (tree type)
|
||||||
|
|
||||||
case VOID_TYPE:
|
case VOID_TYPE:
|
||||||
/* This is an incomplete type and so doesn't have a size. */
|
/* 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;
|
TYPE_USER_ALIGN (type) = 0;
|
||||||
SET_TYPE_MODE (type, VOIDmode);
|
SET_TYPE_MODE (type, VOIDmode);
|
||||||
break;
|
break;
|
||||||
|
@ -2337,7 +2337,7 @@ layout_type (tree type)
|
||||||
#else
|
#else
|
||||||
align = MAX (align, BITS_PER_UNIT);
|
align = MAX (align, BITS_PER_UNIT);
|
||||||
#endif
|
#endif
|
||||||
TYPE_ALIGN (type) = align;
|
SET_TYPE_ALIGN (type, align);
|
||||||
SET_TYPE_MODE (type, BLKmode);
|
SET_TYPE_MODE (type, BLKmode);
|
||||||
if (TYPE_SIZE (type) != 0
|
if (TYPE_SIZE (type) != 0
|
||||||
&& ! targetm.member_type_forces_blk (type, VOIDmode)
|
&& ! targetm.member_type_forces_blk (type, VOIDmode)
|
||||||
|
@ -2609,13 +2609,13 @@ initialize_sizetypes (void)
|
||||||
|
|
||||||
/* Now layout both types manually. */
|
/* Now layout both types manually. */
|
||||||
SET_TYPE_MODE (sizetype, smallest_mode_for_size (precision, MODE_INT));
|
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 (sizetype) = bitsize_int (precision);
|
||||||
TYPE_SIZE_UNIT (sizetype) = size_int (GET_MODE_SIZE (TYPE_MODE (sizetype)));
|
TYPE_SIZE_UNIT (sizetype) = size_int (GET_MODE_SIZE (TYPE_MODE (sizetype)));
|
||||||
set_min_and_max_values_for_integral_type (sizetype, precision, UNSIGNED);
|
set_min_and_max_values_for_integral_type (sizetype, precision, UNSIGNED);
|
||||||
|
|
||||||
SET_TYPE_MODE (bitsizetype, smallest_mode_for_size (bprecision, MODE_INT));
|
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 (bitsizetype) = bitsize_int (bprecision);
|
||||||
TYPE_SIZE_UNIT (bitsizetype)
|
TYPE_SIZE_UNIT (bitsizetype)
|
||||||
= size_int (GET_MODE_SIZE (TYPE_MODE (bitsizetype)));
|
= size_int (GET_MODE_SIZE (TYPE_MODE (bitsizetype)));
|
||||||
|
|
|
@ -2153,7 +2153,7 @@ increase_alignment_1 (symtab_node *n, void *v)
|
||||||
if (DECL_ALIGN (n->decl) < align
|
if (DECL_ALIGN (n->decl) < align
|
||||||
&& n->can_increase_alignment_p ())
|
&& n->can_increase_alignment_p ())
|
||||||
{
|
{
|
||||||
DECL_ALIGN (n->decl) = align;
|
SET_DECL_ALIGN (n->decl, align);
|
||||||
DECL_USER_ALIGN (n->decl) = 1;
|
DECL_USER_ALIGN (n->decl) = 1;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -1856,7 +1856,7 @@ std_gimplify_va_arg_expr (tree valist, tree type, gimple_seq *pre_p,
|
||||||
if (boundary < TYPE_ALIGN (type))
|
if (boundary < TYPE_ALIGN (type))
|
||||||
{
|
{
|
||||||
type = build_variant_type_copy (type);
|
type = build_variant_type_copy (type);
|
||||||
TYPE_ALIGN (type) = boundary;
|
SET_TYPE_ALIGN (type, boundary);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Compute the rounded size of the type. */
|
/* Compute the rounded size of the type. */
|
||||||
|
|
|
@ -1441,7 +1441,13 @@ struct GTY(()) tree_type_common {
|
||||||
unsigned lang_flag_5 : 1;
|
unsigned lang_flag_5 : 1;
|
||||||
unsigned lang_flag_6 : 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;
|
alias_set_type alias_set;
|
||||||
tree pointer_to;
|
tree pointer_to;
|
||||||
tree reference_to;
|
tree reference_to;
|
||||||
|
@ -1542,12 +1548,12 @@ struct GTY(()) tree_decl_common {
|
||||||
unsigned decl_nonshareable_flag : 1;
|
unsigned decl_nonshareable_flag : 1;
|
||||||
|
|
||||||
/* DECL_OFFSET_ALIGN, used only for FIELD_DECLs. */
|
/* DECL_OFFSET_ALIGN, used only for FIELD_DECLs. */
|
||||||
unsigned int off_align : 8;
|
unsigned int off_align : 6;
|
||||||
|
|
||||||
/* 24 bits unused. */
|
|
||||||
|
|
||||||
/* DECL_ALIGN. It should have the same size as TYPE_ALIGN. */
|
/* 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. */
|
/* UID for points-to sets, stable over copying from inlining. */
|
||||||
unsigned int pt_uid;
|
unsigned int pt_uid;
|
||||||
|
|
|
@ -192,7 +192,7 @@ insert_field_into_struct (tree type, tree field)
|
||||||
|
|
||||||
/* Set correct alignment for frame struct type. */
|
/* Set correct alignment for frame struct type. */
|
||||||
if (TYPE_ALIGN (type) < DECL_ALIGN (field))
|
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
|
/* 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))
|
if (use_pointer_in_frame (decl))
|
||||||
{
|
{
|
||||||
TREE_TYPE (field) = build_pointer_type (TREE_TYPE (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;
|
DECL_NONADDRESSABLE_P (field) = 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
TREE_TYPE (field) = TREE_TYPE (decl);
|
TREE_TYPE (field) = TREE_TYPE (decl);
|
||||||
DECL_SOURCE_LOCATION (field) = DECL_SOURCE_LOCATION (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);
|
DECL_USER_ALIGN (field) = DECL_USER_ALIGN (decl);
|
||||||
TREE_ADDRESSABLE (field) = TREE_ADDRESSABLE (decl);
|
TREE_ADDRESSABLE (field) = TREE_ADDRESSABLE (decl);
|
||||||
DECL_NONADDRESSABLE_P (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);
|
field = make_node (FIELD_DECL);
|
||||||
DECL_NAME (field) = get_identifier ("__chain");
|
DECL_NAME (field) = get_identifier ("__chain");
|
||||||
TREE_TYPE (field) = type;
|
TREE_TYPE (field) = type;
|
||||||
DECL_ALIGN (field) = TYPE_ALIGN (type);
|
SET_DECL_ALIGN (field, TYPE_ALIGN (type));
|
||||||
DECL_NONADDRESSABLE_P (field) = 1;
|
DECL_NONADDRESSABLE_P (field) = 1;
|
||||||
|
|
||||||
insert_field_into_struct (get_frame_type (info), field);
|
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_array_type (char_type_node, t);
|
||||||
t = build_decl (DECL_SOURCE_LOCATION (info->context),
|
t = build_decl (DECL_SOURCE_LOCATION (info->context),
|
||||||
FIELD_DECL, get_identifier ("__data"), t);
|
FIELD_DECL, get_identifier ("__data"), t);
|
||||||
DECL_ALIGN (t) = align;
|
SET_DECL_ALIGN (t, align);
|
||||||
DECL_USER_ALIGN (t) = 1;
|
DECL_USER_ALIGN (t) = 1;
|
||||||
|
|
||||||
trampoline_type = make_node (RECORD_TYPE);
|
trampoline_type = make_node (RECORD_TYPE);
|
||||||
|
@ -548,7 +548,7 @@ get_nl_goto_field (struct nesting_info *info)
|
||||||
field = make_node (FIELD_DECL);
|
field = make_node (FIELD_DECL);
|
||||||
DECL_NAME (field) = get_identifier ("__nl_goto_buf");
|
DECL_NAME (field) = get_identifier ("__nl_goto_buf");
|
||||||
TREE_TYPE (field) = type;
|
TREE_TYPE (field) = type;
|
||||||
DECL_ALIGN (field) = TYPE_ALIGN (type);
|
SET_DECL_ALIGN (field, TYPE_ALIGN (type));
|
||||||
TREE_ADDRESSABLE (field) = 1;
|
TREE_ADDRESSABLE (field) = 1;
|
||||||
|
|
||||||
insert_field_into_struct (get_frame_type (info), field);
|
insert_field_into_struct (get_frame_type (info), field);
|
||||||
|
|
|
@ -2114,7 +2114,7 @@ fold_builtin_alloca_with_align (gimple *stmt)
|
||||||
n_elem = size * 8 / BITS_PER_UNIT;
|
n_elem = size * 8 / BITS_PER_UNIT;
|
||||||
array_type = build_array_type_nelts (elem_type, n_elem);
|
array_type = build_array_type_nelts (elem_type, n_elem);
|
||||||
var = create_tmp_var (array_type);
|
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);
|
struct ptr_info_def *pi = SSA_NAME_PTR_INFO (lhs);
|
||||||
if (pi != NULL && !pi->pt.anything)
|
if (pi != NULL && !pi->pt.anything)
|
||||||
|
|
|
@ -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_PRESERVE_P (expr) = (unsigned) bp_unpack_value (bp, 1);
|
||||||
DECL_EXTERNAL (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_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
|
#ifdef ACCEL_COMPILER
|
||||||
if (DECL_ALIGN (expr) > targetm.absolute_biggest_alignment)
|
if (DECL_ALIGN (expr) > targetm.absolute_biggest_alignment)
|
||||||
DECL_ALIGN (expr) = targetm.absolute_biggest_alignment;
|
SET_DECL_ALIGN (expr, targetm.absolute_biggest_alignment);
|
||||||
#endif
|
#endif
|
||||||
if (TREE_CODE (expr) == LABEL_DECL)
|
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)
|
else if (TREE_CODE (expr) == ARRAY_TYPE)
|
||||||
TYPE_NONALIASED_COMPONENT (expr) = (unsigned) bp_unpack_value (bp, 1);
|
TYPE_NONALIASED_COMPONENT (expr) = (unsigned) bp_unpack_value (bp, 1);
|
||||||
TYPE_PRECISION (expr) = bp_unpack_var_len_unsigned (bp);
|
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
|
#ifdef ACCEL_COMPILER
|
||||||
if (TYPE_ALIGN (expr) > targetm.absolute_biggest_alignment)
|
if (TYPE_ALIGN (expr) > targetm.absolute_biggest_alignment)
|
||||||
TYPE_ALIGN (expr) = targetm.absolute_biggest_alignment;
|
SET_TYPE_ALIGN (expr, targetm.absolute_biggest_alignment);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5131,7 +5131,7 @@ ensure_base_align (stmt_vec_info stmt_info, struct data_reference *dr)
|
||||||
symtab_node::get (base_decl)->increase_alignment (TYPE_ALIGN (vectype));
|
symtab_node::get (base_decl)->increase_alignment (TYPE_ALIGN (vectype));
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
DECL_ALIGN (base_decl) = TYPE_ALIGN (vectype);
|
SET_DECL_ALIGN (base_decl, TYPE_ALIGN (vectype));
|
||||||
DECL_USER_ALIGN (base_decl) = 1;
|
DECL_USER_ALIGN (base_decl) = 1;
|
||||||
}
|
}
|
||||||
DR_VECT_AUX (dr)->base_misaligned = false;
|
DR_VECT_AUX (dr)->base_misaligned = false;
|
||||||
|
|
16
gcc/tree.c
16
gcc/tree.c
|
@ -1020,11 +1020,11 @@ make_node_stat (enum tree_code code MEM_STAT_DECL)
|
||||||
{
|
{
|
||||||
if (code == FUNCTION_DECL)
|
if (code == FUNCTION_DECL)
|
||||||
{
|
{
|
||||||
DECL_ALIGN (t) = FUNCTION_BOUNDARY;
|
SET_DECL_ALIGN (t, FUNCTION_BOUNDARY);
|
||||||
DECL_MODE (t) = FUNCTION_MODE;
|
DECL_MODE (t) = FUNCTION_MODE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
DECL_ALIGN (t) = 1;
|
SET_DECL_ALIGN (t, 1);
|
||||||
}
|
}
|
||||||
DECL_SOURCE_LOCATION (t) = input_location;
|
DECL_SOURCE_LOCATION (t) = input_location;
|
||||||
if (TREE_CODE (t) == DEBUG_EXPR_DECL)
|
if (TREE_CODE (t) == DEBUG_EXPR_DECL)
|
||||||
|
@ -1041,7 +1041,7 @@ make_node_stat (enum tree_code code MEM_STAT_DECL)
|
||||||
|
|
||||||
case tcc_type:
|
case tcc_type:
|
||||||
TYPE_UID (t) = next_type_uid++;
|
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_USER_ALIGN (t) = 0;
|
||||||
TYPE_MAIN_VARIANT (t) = t;
|
TYPE_MAIN_VARIANT (t) = t;
|
||||||
TYPE_CANONICAL (t) = t;
|
TYPE_CANONICAL (t) = t;
|
||||||
|
@ -6646,7 +6646,7 @@ build_qualified_type (tree type, int type_quals)
|
||||||
/* Ensure the alignment of this type is compatible with
|
/* Ensure the alignment of this type is compatible with
|
||||||
the required alignment of the atomic type. */
|
the required alignment of the atomic type. */
|
||||||
if (TYPE_ALIGN (atomic_type) > TYPE_ALIGN (t))
|
if (TYPE_ALIGN (atomic_type) > TYPE_ALIGN (t))
|
||||||
TYPE_ALIGN (t) = TYPE_ALIGN (atomic_type);
|
SET_TYPE_ALIGN (t, TYPE_ALIGN (atomic_type));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6685,7 +6685,7 @@ build_aligned_type (tree type, unsigned int align)
|
||||||
return t;
|
return t;
|
||||||
|
|
||||||
t = build_variant_type_copy (type);
|
t = build_variant_type_copy (type);
|
||||||
TYPE_ALIGN (t) = align;
|
SET_TYPE_ALIGN (t, align);
|
||||||
|
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
|
@ -8135,7 +8135,7 @@ build_range_type_1 (tree type, tree lowval, tree highval, bool shared)
|
||||||
SET_TYPE_MODE (itype, TYPE_MODE (type));
|
SET_TYPE_MODE (itype, TYPE_MODE (type));
|
||||||
TYPE_SIZE (itype) = TYPE_SIZE (type);
|
TYPE_SIZE (itype) = TYPE_SIZE (type);
|
||||||
TYPE_SIZE_UNIT (itype) = TYPE_SIZE_UNIT (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);
|
TYPE_USER_ALIGN (itype) = TYPE_USER_ALIGN (type);
|
||||||
|
|
||||||
if (!shared)
|
if (!shared)
|
||||||
|
@ -10036,7 +10036,7 @@ build_atomic_base (tree type, unsigned int align)
|
||||||
set_type_quals (t, TYPE_QUAL_ATOMIC);
|
set_type_quals (t, TYPE_QUAL_ATOMIC);
|
||||||
|
|
||||||
if (align)
|
if (align)
|
||||||
TYPE_ALIGN (t) = align;
|
SET_TYPE_ALIGN (t, align);
|
||||||
|
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
|
@ -10185,7 +10185,7 @@ build_common_tree_nodes (bool signed_char)
|
||||||
|
|
||||||
/* We are not going to have real types in C with less than byte alignment,
|
/* 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. */
|
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;
|
TYPE_USER_ALIGN (void_type_node) = 0;
|
||||||
|
|
||||||
void_node = make_node (VOID_CST);
|
void_node = make_node (VOID_CST);
|
||||||
|
|
30
gcc/tree.h
30
gcc/tree.h
|
@ -916,10 +916,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
|
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
|
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
|
languages where a tag field may show this is an object of a more-aligned
|
||||||
variant of the more generic type.
|
variant of the more generic type. */
|
||||||
|
|
||||||
In an SSA_NAME node, nonzero if the SSA_NAME node is on the SSA_NAME
|
|
||||||
freelist. */
|
|
||||||
#define TYPE_ALIGN_OK(NODE) (TYPE_CHECK (NODE)->base.nothrow_flag)
|
#define TYPE_ALIGN_OK(NODE) (TYPE_CHECK (NODE)->base.nothrow_flag)
|
||||||
|
|
||||||
/* Used in classes in C++. */
|
/* Used in classes in C++. */
|
||||||
|
@ -1865,8 +1862,15 @@ extern machine_mode element_mode (const_tree t);
|
||||||
#define TYPE_ATTRIBUTES(NODE) (TYPE_CHECK (NODE)->type_common.attributes)
|
#define TYPE_ATTRIBUTES(NODE) (TYPE_CHECK (NODE)->type_common.attributes)
|
||||||
|
|
||||||
/* The alignment necessary for objects of this type.
|
/* The alignment necessary for objects of this type.
|
||||||
The value is an int, measured in bits. */
|
The value is an int, measured in bits and must be a power of two.
|
||||||
#define TYPE_ALIGN(NODE) (TYPE_CHECK (NODE)->type_common.align)
|
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,
|
/* 1 if the alignment for this type was requested by "aligned" attribute,
|
||||||
0 if it is the default for this type. */
|
0 if it is the default for this type. */
|
||||||
|
@ -2306,8 +2310,16 @@ extern machine_mode element_mode (const_tree t);
|
||||||
#define DECL_SIZE(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.size)
|
#define DECL_SIZE(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.size)
|
||||||
/* Likewise for the size in bytes. */
|
/* Likewise for the size in bytes. */
|
||||||
#define DECL_SIZE_UNIT(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.size_unit)
|
#define DECL_SIZE_UNIT(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.size_unit)
|
||||||
/* Holds the alignment required for the datum, in bits. */
|
/* Returns the alignment required for the datum, in bits. It must
|
||||||
#define DECL_ALIGN(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.align)
|
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. */
|
/* The alignment of NODE, in bytes. */
|
||||||
#define DECL_ALIGN_UNIT(NODE) (DECL_ALIGN (NODE) / BITS_PER_UNIT)
|
#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
|
/* Set if the alignment of this DECL has been set by the user, for
|
||||||
|
@ -2510,7 +2522,7 @@ extern void decl_value_expr_insert (tree, tree);
|
||||||
#define DECL_OFFSET_ALIGN(NODE) \
|
#define DECL_OFFSET_ALIGN(NODE) \
|
||||||
(((unsigned HOST_WIDE_INT)1) << FIELD_DECL_CHECK (NODE)->decl_common.off_align)
|
(((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) \
|
#define SET_DECL_OFFSET_ALIGN(NODE, X) \
|
||||||
(FIELD_DECL_CHECK (NODE)->decl_common.off_align = ffs_hwi (X) - 1)
|
(FIELD_DECL_CHECK (NODE)->decl_common.off_align = ffs_hwi (X) - 1)
|
||||||
|
|
||||||
|
|
12
gcc/varasm.c
12
gcc/varasm.c
|
@ -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
|
/* Reset the alignment in case we have made it tighter, so we can benefit
|
||||||
from it in get_pointer_alignment. */
|
from it in get_pointer_alignment. */
|
||||||
DECL_ALIGN (decl) = align;
|
SET_DECL_ALIGN (decl, align);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Return DECL_ALIGN (decl), possibly increased for optimization purposes
|
/* 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_protect_global (decl))
|
||||||
{
|
{
|
||||||
asan_protected = true;
|
asan_protected = true;
|
||||||
DECL_ALIGN (decl) = MAX (DECL_ALIGN (decl),
|
SET_DECL_ALIGN (decl, MAX (DECL_ALIGN (decl),
|
||||||
ASAN_RED_ZONE_SIZE * BITS_PER_UNIT);
|
ASAN_RED_ZONE_SIZE * BITS_PER_UNIT));
|
||||||
}
|
}
|
||||||
|
|
||||||
set_mem_align (decl_rtl, DECL_ALIGN (decl));
|
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. */
|
architectures so use DATA_ALIGNMENT as well, except for strings. */
|
||||||
if (TREE_CODE (exp) == STRING_CST)
|
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
|
else
|
||||||
align_variable (decl, 0);
|
align_variable (decl, 0);
|
||||||
|
@ -3404,8 +3404,8 @@ output_constant_def_contents (rtx symbol)
|
||||||
&& asan_protect_global (exp))
|
&& asan_protect_global (exp))
|
||||||
{
|
{
|
||||||
asan_protected = true;
|
asan_protected = true;
|
||||||
DECL_ALIGN (decl) = MAX (DECL_ALIGN (decl),
|
SET_DECL_ALIGN (decl, MAX (DECL_ALIGN (decl),
|
||||||
ASAN_RED_ZONE_SIZE * BITS_PER_UNIT);
|
ASAN_RED_ZONE_SIZE * BITS_PER_UNIT));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If the constant is part of an object block, make sure that the
|
/* If the constant is part of an object block, make sure that the
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
|
2016-04-18 Michael Matz <matz@suse.de>
|
||||||
|
|
||||||
|
* plugin.cc (plugin_finish_record_or_union): Use SET_TYPE_ALIGN.
|
||||||
|
|
||||||
2016-04-11 Segher Boessenkool <segher@kernel.crashing.org>
|
2016-04-11 Segher Boessenkool <segher@kernel.crashing.org>
|
||||||
|
|
||||||
PR bootstrap/70173
|
PR bootstrap/70173
|
||||||
|
|
|
@ -553,8 +553,8 @@ plugin_finish_record_or_union (cc1_plugin::connection *,
|
||||||
{
|
{
|
||||||
// FIXME there's no way to get this from DWARF,
|
// FIXME there's no way to get this from DWARF,
|
||||||
// or even, it seems, a particularly good way to deduce it.
|
// or even, it seems, a particularly good way to deduce it.
|
||||||
TYPE_ALIGN (record_or_union_type)
|
SET_TYPE_ALIGN (record_or_union_type,
|
||||||
= TYPE_PRECISION (pointer_sized_int_node);
|
TYPE_PRECISION (pointer_sized_int_node));
|
||||||
|
|
||||||
TYPE_SIZE (record_or_union_type) = bitsize_int (size_in_bytes
|
TYPE_SIZE (record_or_union_type) = bitsize_int (size_in_bytes
|
||||||
* BITS_PER_UNIT);
|
* BITS_PER_UNIT);
|
||||||
|
|
Loading…
Reference in New Issue