aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2020-09-11 11:13:54 +0200
committerEric Botcazou <ebotcazou@adacore.com>2020-09-11 11:13:54 +0200
commitb5ffd55a61df01d226f3fa4260f108bda8565c16 (patch)
treef20be982bb51bec05d0239653f6b07d04e001a00 /gcc/ada
parent230e0dbdcbb55c5ec3cbb236db4302cd18a1a01d (diff)
downloadgcc-b5ffd55a61df01d226f3fa4260f108bda8565c16.zip
gcc-b5ffd55a61df01d226f3fa4260f108bda8565c16.tar.gz
gcc-b5ffd55a61df01d226f3fa4260f108bda8565c16.tar.bz2
Add missing stride entry in debug info
This adds a missing stride entry for bit-packed arrays of record types. gcc/ada/ChangeLog: * gcc-interface/misc.c (get_array_bit_stride): Return TYPE_ADA_SIZE for record and union types.
Diffstat (limited to 'gcc/ada')
-rw-r--r--gcc/ada/gcc-interface/misc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/ada/gcc-interface/misc.c b/gcc/ada/gcc-interface/misc.c
index e6a563e..781868e 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);