@@ -1182,20 +1182,19 @@ offset for the field.
11821182 /* Store the base class name. */
11831183 (void)strcpy(name_ptr+prefix_length, temp_name);
11841184 /* Create the field. */
1185- #if IA64_ABI
11861185 field_ptr = add_field(name_ptr, field_type, field_offset, struct_type,
11871186 /*for_base_class=*/TRUE);
1188- if (targ_reuse_tail_padding && is_immediate_class_type(field_type) &&
1187+ if (
1188+ #if IA64_ABI
1189+ targ_reuse_tail_padding &&
1190+ #endif /* IA64_ABI */
1191+ is_immediate_class_type(field_type) &&
11891192 class_type_supp(field_type)->compiler_generated &&
11901193 (field_type->size % field_type->alignment) != 0) {
11911194 /* There is padding at the end of the base class subobject in which
11921195 derived class members may be allocated. */
11931196 field_ptr->class_subobject_with_tail_padding = TRUE;
11941197 } /* if */
1195- #else /* !IA64_ABI */
1196- field_ptr = add_field(name_ptr, field_type, field_offset, struct_type,
1197- /*for_base_class=*/TRUE);
1198- #endif /* IA64_ABI */
11991198 field_ptr->is_lowered_base_class = TRUE;
12001199} /* add_base_class_dummy_field */
12011200
@@ -8534,13 +8533,21 @@ this routine to do a relatively simple copy of all the fields.
85348533
85358534 ctsp = class_type->variant.class_struct_union.extra_info;
85368535 if ((!class_type->variant.class_struct_union.any_virtual_base_classes
8536+ #if !IA64_ABI
8537+ /* The size as a base can still be smaller than the size of the class
8538+ (in Microsoft mode, which ignores some alignment requirements when
8539+ computing the size of a base class). */
8540+ && (class_type->kind == tk_union ||
8541+ ctsp->size_without_virtual_base_classes == class_type->size)
8542+ #endif /* !IA64_ABI */
85378543#if CFRONT_OBJECT_CODE_COMPATIBILITY
8538- || !class_has_independently_allocated_virtual_base_classes(class_type)
8544+ || (class_type->variant.class_struct_union.any_virtual_base_classes &&
8545+ !class_has_independently_allocated_virtual_base_classes(class_type))
85398546#endif /* CFRONT_OBJECT_CODE_COMPATIBILITY */
85408547 )
85418548#if IA64_ABI
85428549 && (!targ_reuse_tail_padding ||
8543- class_type->kind == (a_type_kind) tk_union ||
8550+ class_type->kind == tk_union ||
85448551 ctsp->size_without_virtual_base_classes == class_type->size)
85458552#endif /* IA64_ABI */
85468553 ) {
@@ -10020,7 +10027,7 @@ Do IL lowering of the indicated field and everything under it.
1002010027 mark_as_visited(field);
1002110028 lower_source_correspondence(&field->source_corresp);
1002210029 lower_os_type(field->type);
10023- #if BACK_END_IS_C_GEN_BE && IA64_ABI && MAINTAIN_NEEDED_FLAGS
10030+ #if BACK_END_IS_C_GEN_BE && MAINTAIN_NEEDED_FLAGS
1002410031 if (field->class_subobject_with_tail_padding) {
1002510032 /* Ensure that the corresponding subobject type definition is not
1002610033 removed from the IL, as it will be needed by the C-generating back
@@ -10031,7 +10038,7 @@ Do IL lowering of the indicated field and everything under it.
1003110038 class_type_supp(ftp)->subobject_partner->
1003210039 variant.class_struct_union.keep_definition_in_il = TRUE;
1003310040 } /* if */
10034- #endif /* BACK_END_IS_C_GEN_BE && IA64_ABI && MAINTAIN_NEEDED_FLAGS */
10041+ #endif /* BACK_END_IS_C_GEN_BE && MAINTAIN_NEEDED_FLAGS */
1003510042 } /* if */
1003610043} /* lower_field */
1003710044
0 commit comments