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 r13-484] [Ada] Fix internal error on mix of controlled and protected types
Date: Mon, 16 May 2022 08:43:42 +0000 (GMT)	[thread overview]
Message-ID: <20220516084342.361AD3857C4E@sourceware.org> (raw)

https://gcc.gnu.org/g:146ea83af978384b0f7dabc8176f8bf98892ce2a

commit r13-484-g146ea83af978384b0f7dabc8176f8bf98892ce2a
Author: Eric Botcazou <ebotcazou@adacore.com>
Date:   Thu Mar 10 11:11:32 2022 +0100

    [Ada] Fix internal error on mix of controlled and protected types
    
    The key is that the protected type is a (limited) private type, which
    fools a test in Cleanup_Scopes.
    
    gcc/ada/
    
            * inline.adb (Cleanup_Scopes): Test the underlying type.

Diff:
---
 gcc/ada/inline.adb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/ada/inline.adb b/gcc/ada/inline.adb
index 5944aed0b00..a1d22544874 100644
--- a/gcc/ada/inline.adb
+++ b/gcc/ada/inline.adb
@@ -2773,7 +2773,7 @@ package body Inline is
             Scop := Protected_Body_Subprogram (Scop);
 
          elsif Is_Subprogram (Scop)
-           and then Is_Protected_Type (Scope (Scop))
+           and then Is_Protected_Type (Underlying_Type (Scope (Scop)))
            and then Present (Protected_Body_Subprogram (Scop))
          then
             --  If a protected operation contains an instance, its cleanup


                 reply	other threads:[~2022-05-16  8:43 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=20220516084342.361AD3857C4E@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).