On Mon, Sep 21, 2026 at 9:37 AM Eric Botcazou <[email protected]> wrote: > > Hi, > > In Ada, small bit-packed array types are represented by modular (aka unsigned) > integer types under the hood and, in this case, the debug info generated for > them is incorrect if they are declared with the reverse scalar storage order. > > This is fixed by adding a reverse_storage_order field to the array_descr_info > structure that is filled by the LANG_HOOKS_GET_ARRAY_DESCR_INFO language hook > and setting it properly in the front-end. The only other front-end declaring > this hook is the Fortran front-end and 1) AFAIK the language does not support > toggling the scalar storage order and 2) the language hook first clears the > entire structure before returning true, so no changes is made to it. > > Tested on x86-64/Linux, OK for the mainline?
OK. Thanks, Richard. > > > 2026-09-21 Eric Botcazou <[email protected]> > > * dwarf2out.h (struct array_descr_info): Add reverse_storage_order. > * dwarf2out.cc (gen_descr_array_type_die): Pass it in the call to > add_type_attribute instead of using TYPE_REVERSE_STORAGE_ORDER. > ada/ > * gcc-interface/misc.cc (gnat_get_array_descr_info): Return the > TYPE_REVERSE_STORAGE_ORDER flag of the underlying array type. > > -- > Eric Botcazou
