public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [Ada] Add missing stride entry in debug info
@ 2020-09-11  9:23 Eric Botcazou
  0 siblings, 0 replies; only message in thread
From: Eric Botcazou @ 2020-09-11  9:23 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 297 bytes --]

This adds a missing stride entry for bit-packed arrays of record types.

Tested on x86_64-suse-linux, applied on the mainline.


2020-09-11  Eric Botcazou  <ebotcazou@adacore.com>

	* gcc-interface/misc.c (get_array_bit_stride): Return TYPE_ADA_SIZE
	for record and union types.

-- 
Eric Botcazou

[-- Attachment #2: p.diff --]
[-- Type: text/x-patch, Size: 603 bytes --]

diff --git a/gcc/ada/gcc-interface/misc.c b/gcc/ada/gcc-interface/misc.c
index e6a563e3666..781868e2ad3 100644
--- a/gcc/ada/gcc-interface/misc.c
+++ b/gcc/ada/gcc-interface/misc.c
@@ -1003,6 +1003,10 @@ get_array_bit_stride (tree comp_type)
   if (INTEGRAL_TYPE_P (comp_type))
     return TYPE_RM_SIZE (comp_type);
 
+  /* Likewise for record or union types.  */
+  if (RECORD_OR_UNION_TYPE_P (comp_type) && !TYPE_FAT_POINTER_P (comp_type))
+    return TYPE_ADA_SIZE (comp_type);
+
   /* The gnat_get_array_descr_info debug hook expects a debug tyoe.  */
   comp_type = maybe_debug_type (comp_type);
 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-09-11  9:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-11  9:23 [Ada] Add missing stride entry in debug info Eric Botcazou

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).