public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Pierre-Marie de Rodat <pmderodat@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r12-5038] [Ada] Hang on compilation of unit with type extension in body
Date: Tue,  9 Nov 2021 09:47:21 +0000 (GMT)	[thread overview]
Message-ID: <20211109094721.EC77A385843B@sourceware.org> (raw)

https://gcc.gnu.org/g:9f24d32cf6ae542f779a309e4b2f6c77fb6af4f7

commit r12-5038-g9f24d32cf6ae542f779a309e4b2f6c77fb6af4f7
Author: Justin Squirek <squirek@adacore.com>
Date:   Fri Oct 29 23:43:38 2021 -0400

    [Ada] Hang on compilation of unit with type extension in body
    
    gcc/ada/
    
            * exp_util.adb (Ancestor_Primitive): Prevent return of an
            subprogram alias when the ancestor primitive of the alias is the
            same as Subp.

Diff:
---
 gcc/ada/exp_util.adb | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/gcc/ada/exp_util.adb b/gcc/ada/exp_util.adb
index b0ea44a7f7b..1bba0595741 100644
--- a/gcc/ada/exp_util.adb
+++ b/gcc/ada/exp_util.adb
@@ -10433,6 +10433,14 @@ package body Exp_Util is
          --  inherited ancestor primitive.
 
          elsif Present (Inher_Prim) then
+            --  It is possible that an internally generated alias could be
+            --  set to a subprogram which overrides the same aliased primitive,
+            --  so return Empty in this case.
+
+            if Ancestor_Primitive (Inher_Prim) = Subp then
+               return Empty;
+            end if;
+
             return Inher_Prim;
 
          --  Otherwise the current subprogram is the root of the inheritance or


                 reply	other threads:[~2021-11-09  9:47 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=20211109094721.EC77A385843B@sourceware.org \
    --to=pmderodat@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).