public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Eric Botcazou <ebotcazou@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r10-10121] Fix inaccurate bounds in debug info for vector array types
Date: Tue, 14 Sep 2021 09:12:31 +0000 (GMT)	[thread overview]
Message-ID: <20210914091231.1A9973858018@sourceware.org> (raw)

https://gcc.gnu.org/g:1f17aab16b06846b2911179b0206fc2801cc0f47

commit r10-10121-g1f17aab16b06846b2911179b0206fc2801cc0f47
Author: Eric Botcazou <ebotcazou@adacore.com>
Date:   Tue Sep 14 11:10:17 2021 +0200

    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.

Diff:
---
 gcc/ada/gcc-interface/decl.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c
index efbcf70eadc..80107a69060 100644
--- a/gcc/ada/gcc-interface/decl.c
+++ b/gcc/ada/gcc-interface/decl.c
@@ -4707,6 +4707,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.  */


                 reply	other threads:[~2021-09-14  9:12 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210914091231.1A9973858018@sourceware.org \
    --to=ebotcazou@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).