> This is the mode where the GNAT compiler does not use special encodings in
> the debug info to describe some Ada constructs, for example packed array
> types.

This fixes a small fallout of the patch.  Tested on x86-64/Linux, applied on 
the mainline.


2020-05-25  Eric Botcazou  <ebotca...@adacore.com>

        * gcc-interface/misc.c (get_array_bit_stride): Get to the debug type,
        if any, before calling gnat_get_array_descr_info.

-- 
Eric Botcazou
diff --git a/gcc/ada/gcc-interface/misc.c b/gcc/ada/gcc-interface/misc.c
index 5a5850a85e0..f8fa8563161 100644
--- a/gcc/ada/gcc-interface/misc.c
+++ b/gcc/ada/gcc-interface/misc.c
@@ -1003,6 +1003,9 @@ get_array_bit_stride (tree comp_type)
   if (INTEGRAL_TYPE_P (comp_type))
     return TYPE_RM_SIZE (comp_type);
 
+  /* The gnat_get_array_descr_info debug hook expects a debug tyoe.  */
+  comp_type = maybe_debug_type (comp_type);
+
   /* Otherwise, see if this is an array we can analyze; if it's not, punt.  */
   memset (&info, 0, sizeof (info));
   if (!gnat_get_array_descr_info (comp_type, &info) || !info.stride)

Reply via email to