diff options
Diffstat (limited to 'gcc/ada/gcc-interface')
-rw-r--r-- | gcc/ada/gcc-interface/decl.cc | 14 | ||||
-rw-r--r-- | gcc/ada/gcc-interface/misc.cc | 7 |
2 files changed, 15 insertions, 6 deletions
diff --git a/gcc/ada/gcc-interface/decl.cc b/gcc/ada/gcc-interface/decl.cc index 5e16b56..20ab185 100644 --- a/gcc/ada/gcc-interface/decl.cc +++ b/gcc/ada/gcc-interface/decl.cc @@ -5114,7 +5114,7 @@ inline_status_for_subprog (Entity_Id subprog) tree gnu_type; /* This is a kludge to work around a pass ordering issue: for small - record types with many components, i.e. typically bit-fields, the + record types with many components, i.e. typically bitfields, the initialization routine can contain many assignments that will be merged by the GIMPLE store merging pass. But this pass runs very late in the pipeline, in particular after the inlining decisions @@ -7702,6 +7702,18 @@ gnat_to_gnu_field (Entity_Id gnat_field, tree gnu_record_type, int packed, gnu_field_type = maybe_pad_type (gnu_field_type, gnu_size, 0, gnat_field, false, definition, true); + /* For a bitfield, if the type still has BLKmode, try again to change it + to an integral mode form. This may be necessary on strict-alignment + platforms with a size clause that is much larger than the field type, + because maybe_pad_type has preserved the alignment of the field type, + which may be too low for the new size. */ + if (!needs_strict_alignment + && RECORD_OR_UNION_TYPE_P (gnu_field_type) + && !TYPE_FAT_POINTER_P (gnu_field_type) + && TYPE_MODE (gnu_field_type) == BLKmode + && is_bitfield) + gnu_field_type = make_packable_type (gnu_field_type, true, 1); + /* If a padding record was made, declare it now since it will never be declared otherwise. This is necessary to ensure that its subtrees are properly marked. */ diff --git a/gcc/ada/gcc-interface/misc.cc b/gcc/ada/gcc-interface/misc.cc index 3b21bf5..453ae80 100644 --- a/gcc/ada/gcc-interface/misc.cc +++ b/gcc/ada/gcc-interface/misc.cc @@ -269,7 +269,7 @@ gnat_post_options (const char **pfilename ATTRIBUTE_UNUSED) /* No caret by default for Ada. */ if (!OPTION_SET_P (flag_diagnostics_show_caret)) - global_dc->show_caret = false; + global_dc->m_source_printing.enabled = false; /* Copy global settings to local versions. */ gnat_encodings = global_options.x_gnat_encodings; @@ -293,7 +293,6 @@ static void internal_error_function (diagnostic_context *context, const char *msgid, va_list *ap) { - text_info tinfo; char *buffer, *p, *loc; String_Template temp, temp_loc; String_Pointer sp, sp_loc; @@ -309,9 +308,7 @@ internal_error_function (diagnostic_context *context, const char *msgid, pp_clear_output_area (context->printer); /* Format the message into the pretty-printer. */ - tinfo.format_spec = msgid; - tinfo.args_ptr = ap; - tinfo.err_no = errno; + text_info tinfo (msgid, ap, errno); pp_format_verbatim (context->printer, &tinfo); /* Extract a (writable) pointer to the formatted text. */ |