public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-5037] [Ada] Crash on expansion of tagged membership test
@ 2021-11-09  9:47 Pierre-Marie de Rodat
  0 siblings, 0 replies; only message in thread
From: Pierre-Marie de Rodat @ 2021-11-09  9:47 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:686b427ff408de245a84ec90640fcf36011be5ab

commit r12-5037-g686b427ff408de245a84ec90640fcf36011be5ab
Author: Justin Squirek <squirek@adacore.com>
Date:   Fri Oct 29 16:40:17 2021 -0400

    [Ada] Crash on expansion of tagged membership test
    
    gcc/ada/
    
            * exp_ch4.adb (Tagged_Membership): Use corresponding record type
            when expanding a tagged membership test on protected types.

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

diff --git a/gcc/ada/exp_ch4.adb b/gcc/ada/exp_ch4.adb
index 3db43dd870a..f3923e914d7 100644
--- a/gcc/ada/exp_ch4.adb
+++ b/gcc/ada/exp_ch4.adb
@@ -15346,6 +15346,17 @@ package body Exp_Ch4 is
    begin
       SCIL_Node := Empty;
 
+      --  We have to examine the corresponding record type when dealing with
+      --  protected types instead of the original, unexpanded, type.
+
+      if Ekind (Right_Type) = E_Protected_Type then
+         Right_Type := Corresponding_Record_Type (Right_Type);
+      end if;
+
+      if Ekind (Left_Type) = E_Protected_Type then
+         Left_Type := Corresponding_Record_Type (Left_Type);
+      end if;
+
       --  In the case where the type is an access type, the test is applied
       --  using the designated types (needed in Ada 2012 for implicit anonymous
       --  access conversions, for AI05-0149).


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-11-09  9:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-09  9:47 [gcc r12-5037] [Ada] Crash on expansion of tagged membership test Pierre-Marie de Rodat

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).