diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2021-09-14 11:10:17 +0200 |
---|---|---|
committer | Eric Botcazou <ebotcazou@adacore.com> | 2021-09-14 11:10:17 +0200 |
commit | b9c35857d00c66158fcdf7de8adae4f06023052e (patch) | |
tree | e038c8aa9ff0d2925083d1a92437cb072b49a6bd /gcc/ada/gcc-interface/decl.c | |
parent | 26864014bba4ccd33cddbf7d9cd81fe9685e7f7c (diff) | |
download | gcc-b9c35857d00c66158fcdf7de8adae4f06023052e.zip gcc-b9c35857d00c66158fcdf7de8adae4f06023052e.tar.gz gcc-b9c35857d00c66158fcdf7de8adae4f06023052e.tar.bz2 |
Fix inaccurate bounds in debug info for vector array types
They should not be 0-based, unless the array type itself is.
gcc/ada/
* gcc-interface/decl.c (gnat_to_gnu_entity): For vector types, make
the representative array the debug type.
Diffstat (limited to 'gcc/ada/gcc-interface/decl.c')
-rw-r--r-- | gcc/ada/gcc-interface/decl.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c index 9202184..20e3eea 100644 --- a/gcc/ada/gcc-interface/decl.c +++ b/gcc/ada/gcc-interface/decl.c @@ -4740,6 +4740,14 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition) else gnu_decl = create_type_decl (gnu_entity_name, gnu_type, artificial_p, debug_info_p, gnat_entity); + + /* For vector types, make the representative array the debug type. */ + if (VECTOR_TYPE_P (gnu_type)) + { + tree rep = TYPE_REPRESENTATIVE_ARRAY (gnu_type); + TYPE_NAME (rep) = DECL_NAME (gnu_decl); + SET_TYPE_DEBUG_TYPE (gnu_type, rep); + } } /* Otherwise, for a type reusing an existing DECL, back-annotate values. */ |