From 1d0275e2bba963ca0292c258c62a6a221b2e77ca Mon Sep 17 00:00:00 2001 From: Trevor Saunders Date: Tue, 28 Apr 2015 04:42:04 +0000 Subject: [PATCH] add default for PCC_BITFIELD_TYPE_MATTERS gcc/ChangeLog: 2015-04-27 Trevor Saunders * defaults.h (PCC_BITFIELD_TYPE_MATTERS): Add default definition to false. * dwarf2out.c (field_byte_offset): REmove check if PCC_BITFIELD_TYPE_MATTERS is defined. * stor-layout.c (layout_decl): Likewise. (update_alignment_for_field): Likewise. (place_field): Likewise. gcc/cp/ChangeLog: 2015-04-27 Trevor Saunders * class.c (layout_class_type): Remove check if PCC_BITFIELD_TYPE_MATTERS is defined. From-SVN: r222503 --- gcc/ChangeLog | 10 ++++++++++ gcc/cp/ChangeLog | 5 +++++ gcc/cp/class.c | 4 ++-- gcc/defaults.h | 4 ++++ gcc/dwarf2out.c | 2 -- gcc/stor-layout.c | 10 ---------- 6 files changed, 21 insertions(+), 14 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f8ee0d7b65a..72c753d24e4 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,13 @@ +2015-04-27 Trevor Saunders + + * defaults.h (PCC_BITFIELD_TYPE_MATTERS): Add default definition + to false. + * dwarf2out.c (field_byte_offset): REmove check if + PCC_BITFIELD_TYPE_MATTERS is defined. + * stor-layout.c (layout_decl): Likewise. + (update_alignment_for_field): Likewise. + (place_field): Likewise. + 2015-04-27 Trevor Saunders * defaults.h (HARD_REGNO_RENAME_OK): Add default definition to diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 20d4ab2b535..3f91187aa97 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2015-04-27 Trevor Saunders + + * class.c (layout_class_type): Remove check if + PCC_BITFIELD_TYPE_MATTERS is defined. + 2015-04-27 Jim Wilson * Make-lang.in (c++.mostlyclean): Remove xg++, g++-cross, and cc1plus. diff --git a/gcc/cp/class.c b/gcc/cp/class.c index d80d312e7d2..be5f5c22fff 100644 --- a/gcc/cp/class.c +++ b/gcc/cp/class.c @@ -6258,7 +6258,7 @@ layout_class_type (tree t, tree *virtuals_p) padding = size_binop (MINUS_EXPR, DECL_SIZE (field), TYPE_SIZE (integer_type)); } -#ifdef PCC_BITFIELD_TYPE_MATTERS + /* An unnamed bitfield does not normally affect the alignment of the containing class on a target where PCC_BITFIELD_TYPE_MATTERS. But, the C++ ABI does not @@ -6270,7 +6270,7 @@ layout_class_type (tree t, tree *virtuals_p) was_unnamed_p = true; DECL_NAME (field) = make_anon_name (); } -#endif + DECL_SIZE (field) = TYPE_SIZE (integer_type); DECL_ALIGN (field) = TYPE_ALIGN (integer_type); DECL_USER_ALIGN (field) = TYPE_USER_ALIGN (integer_type); diff --git a/gcc/defaults.h b/gcc/defaults.h index 7e04be2c7a8..0af7a027606 100644 --- a/gcc/defaults.h +++ b/gcc/defaults.h @@ -1201,6 +1201,10 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #define DEFAULT_PCC_STRUCT_RETURN 1 #endif +#ifndef PCC_BITFIELD_TYPE_MATTERS +#define PCC_BITFIELD_TYPE_MATTERS false +#endif + #ifndef INSN_SETS_ARE_DELAYED #define INSN_SETS_ARE_DELAYED(INSN) false #endif diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index a04e6f67314..8591cd76f15 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -15120,7 +15120,6 @@ field_byte_offset (const_tree decl) bitpos_int = wi::to_offset (bit_position (decl)); -#ifdef PCC_BITFIELD_TYPE_MATTERS if (PCC_BITFIELD_TYPE_MATTERS) { tree type; @@ -15218,7 +15217,6 @@ field_byte_offset (const_tree decl) } } else -#endif /* PCC_BITFIELD_TYPE_MATTERS */ object_offset_in_bits = bitpos_int; object_offset_in_bytes diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c index 54bbde67d82..1d1de997363 100644 --- a/gcc/stor-layout.c +++ b/gcc/stor-layout.c @@ -85,10 +85,8 @@ static tree self_referential_size (tree); static void finalize_record_size (record_layout_info); static void finalize_type_size (tree); static void place_union_field (record_layout_info, tree); -#if defined (PCC_BITFIELD_TYPE_MATTERS) || defined (BITFIELD_NBYTES_LIMITED) static int excess_unit_span (HOST_WIDE_INT, HOST_WIDE_INT, HOST_WIDE_INT, HOST_WIDE_INT, tree); -#endif extern void debug_rli (record_layout_info); /* Show that REFERENCE_TYPES are internal and should use address_mode. @@ -703,11 +701,9 @@ layout_decl (tree decl, unsigned int known_align) { zero_bitfield = true; packed_p = false; -#ifdef PCC_BITFIELD_TYPE_MATTERS if (PCC_BITFIELD_TYPE_MATTERS) do_type_align (type, decl); else -#endif { #ifdef EMPTY_FIELD_BOUNDARY if (EMPTY_FIELD_BOUNDARY > DECL_ALIGN (decl)) @@ -1071,7 +1067,6 @@ update_alignment_for_field (record_layout_info rli, tree field, rli->unpacked_align = MAX (rli->unpacked_align, TYPE_ALIGN (type)); } } -#ifdef PCC_BITFIELD_TYPE_MATTERS else if (is_bitfield && PCC_BITFIELD_TYPE_MATTERS) { /* Named bit-fields cause the entire structure to have the @@ -1114,7 +1109,6 @@ update_alignment_for_field (record_layout_info rli, tree field, user_align |= TYPE_USER_ALIGN (type); } } -#endif else { rli->record_align = MAX (rli->record_align, desired_align); @@ -1152,7 +1146,6 @@ place_union_field (record_layout_info rli, tree field) DECL_SIZE_UNIT (field), rli->offset); } -#if defined (PCC_BITFIELD_TYPE_MATTERS) || defined (BITFIELD_NBYTES_LIMITED) /* A bitfield of SIZE with a required access alignment of ALIGN is allocated at BYTE_OFFSET / BIT_OFFSET. Return nonzero if the field would span more units of alignment than the underlying TYPE. */ @@ -1168,7 +1161,6 @@ excess_unit_span (HOST_WIDE_INT byte_offset, HOST_WIDE_INT bit_offset, return ((offset + size + align - 1) / align > tree_to_uhwi (TYPE_SIZE (type)) / align); } -#endif /* RLI contains information about the layout of a RECORD_TYPE. FIELD is a FIELD_DECL to be added after those fields already present in @@ -1295,7 +1287,6 @@ place_field (record_layout_info rli, tree field) /* Handle compatibility with PCC. Note that if the record has any variable-sized fields, we need not worry about compatibility. */ -#ifdef PCC_BITFIELD_TYPE_MATTERS if (PCC_BITFIELD_TYPE_MATTERS && ! targetm.ms_bitfield_layout_p (rli->t) && TREE_CODE (field) == FIELD_DECL @@ -1340,7 +1331,6 @@ place_field (record_layout_info rli, tree field) if (! DECL_PACKED (field)) TYPE_USER_ALIGN (rli->t) |= TYPE_USER_ALIGN (type); } -#endif #ifdef BITFIELD_NBYTES_LIMITED if (BITFIELD_NBYTES_LIMITED -- 2.30.2