aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_aux.adb
diff options
context:
space:
mode:
authorYannick Moy <moy@adacore.com>2021-11-02 15:43:42 +0100
committerPierre-Marie de Rodat <derodat@adacore.com>2021-11-10 08:57:39 +0000
commit94396a27bcfbdcb156586688de9a5a2e1bee2d4a (patch)
treef405942d36ae05264fdcfff033642673bd62d997 /gcc/ada/sem_aux.adb
parenta0546e1a169954bb412debeab777f9108950bc8d (diff)
downloadgcc-94396a27bcfbdcb156586688de9a5a2e1bee2d4a.zip
gcc-94396a27bcfbdcb156586688de9a5a2e1bee2d4a.tar.gz
gcc-94396a27bcfbdcb156586688de9a5a2e1bee2d4a.tar.bz2
[Ada] Create explicit ghost mirror unit for big integers
gcc/ada/ * Makefile.rtl: Add unit. * libgnat/a-nbnbin__ghost.adb: Move... * libgnat/a-nbnbig.adb: ... here. Mark ghost as ignored. * libgnat/a-nbnbin__ghost.ads: Move... * libgnat/a-nbnbig.ads: ... here. Add comment for purpose of this unit. Mark ghost as ignored. * libgnat/s-widthu.adb: Use new unit. * sem_aux.adb (First_Subtype): Adapt to the case of a ghost type whose freeze node is rewritten to a null statement.
Diffstat (limited to 'gcc/ada/sem_aux.adb')
-rw-r--r--gcc/ada/sem_aux.adb10
1 files changed, 9 insertions, 1 deletions
diff --git a/gcc/ada/sem_aux.adb b/gcc/ada/sem_aux.adb
index dcced7e..e1bcf53 100644
--- a/gcc/ada/sem_aux.adb
+++ b/gcc/ada/sem_aux.adb
@@ -336,10 +336,18 @@ package body Sem_Aux is
function First_Subtype (Typ : Entity_Id) return Entity_Id is
B : constant Entity_Id := Base_Type (Typ);
- F : constant Node_Id := Freeze_Node (B);
+ F : Node_Id := Freeze_Node (B);
Ent : Entity_Id;
begin
+ -- The freeze node of a ghost type might have been rewritten in a null
+ -- statement by the time gigi calls First_Subtype on the corresponding
+ -- type.
+
+ if Nkind (F) = N_Null_Statement then
+ F := Original_Node (F);
+ end if;
+
-- If the base type has no freeze node, it is a type in Standard, and
-- always acts as its own first subtype, except where it is one of the
-- predefined integer types. If the type is formal, it is also a first