From patchwork Tue May 23 08:08:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Marc_Poulhi=C3=A8s?= X-Patchwork-Id: 97890 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1980996vqo; Tue, 23 May 2023 01:29:04 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6x4gKVGSlGjOLjn75h+ygTRRLaAm9Ay14UL2QGzJGrgzDx6A6+uufwkZIgqFQhPfMNdBUs X-Received: by 2002:a17:906:a1d0:b0:94f:31da:8c37 with SMTP id bx16-20020a170906a1d000b0094f31da8c37mr11479948ejb.52.1684830544461; Tue, 23 May 2023 01:29:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684830544; cv=none; d=google.com; s=arc-20160816; b=jnRcPsutEyp7nqgQm4gORuQ6U7zvR4yLSLTFLtmMgHyJDpfWGiMgVdpRlpOfIzFOmV nJ7tItRiBX+aSRjNvRwNQL93Rj6Fp8SFqRB2dy6RhvxQgMJ7JnjANhd8l+0255XeEcdh MTFPQtvvRm348HgeccN1nx1YufRIfdxDVDWa8ajYdzPpBbsGngQjbBSptAwFhDAhqCRg auJ5N1070J6GiDlGn2RmHcihw09GM0oHmptxsz/2N9e+wD8mlusNFy+I3YO2VLVsagNx 6yXlSwBZHktAczDRXMgnI43wPsXe2lH5Lea1O/kvPOKSvVNWS7o9Mc6BbRTD74TYaWS4 J48w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:message-id:date:subject:cc :to:dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=5bZc1lm8tzzgT7wPMSZy9q1Mmz+qYR9fmlMfGufqHoA=; b=Q5d/UAiLBoVICw1qvUo0lAeLLD9yYAAoqC/u9u7f7WnzMfjcwpKsHLevSy+mxWluk9 wC7lnzLtCWpoMJFT7+D+xWFexs+m5GPh9EZWwQTEDCGObg4MEOXuFS+SAJQydf1gKwhG cEjaMPoKeVF6CMrO4hAm5GKxsYAPW5D3Kj2g1O61e+YDI7wAGGmlctCQkW4DXaVmzjuw Pty7fa8EMp20xsDkZqXMwdScujHrelJ8eX7uBi2KF4OrdTHJ8v9i8Y31KCMhsSO3YoMD vhJrMUoLuPYfQfG0gFlbjVg+XwuJHnmn4arFCwnJF+xu5Qyz39s8WQSi4RCMVTLmKKhk RCYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=Wc7UTZEk; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id o21-20020a170906769500b009669c99c90fsi4607056ejm.350.2023.05.23.01.29.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 May 2023 01:29:04 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=Wc7UTZEk; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id CD98E388A83F for ; Tue, 23 May 2023 08:18:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CD98E388A83F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1684829896; bh=5bZc1lm8tzzgT7wPMSZy9q1Mmz+qYR9fmlMfGufqHoA=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=Wc7UTZEk8PsDIAxTXbh+etnYzfue17sgg8+ykPjwNTsL5jGDhTzIUm8WfZ5aRIYmF GsFch95AOadCid0efTBMKAeEQ52Ul7m4HJXVZKqsW5Eo5FZH1lsYrhEMs78BcFiVbz mr0T0IROX9HfoGg1JceTKs0tDvKWFjSa+Nbq8o6M= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by sourceware.org (Postfix) with ESMTPS id C039C3882022 for ; Tue, 23 May 2023 08:08:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C039C3882022 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-3f607839b89so11625295e9.3 for ; Tue, 23 May 2023 01:08:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684829307; x=1687421307; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=5bZc1lm8tzzgT7wPMSZy9q1Mmz+qYR9fmlMfGufqHoA=; b=T/BsFHItds7tuMiPt5NDnlVsAr7uugtMAHsjiEujkQkymYq3wCCoTrk1X2yRd/MVIk z5foG1JAW3vSsFJ1vPvaWQbXJ90XIGgamU+epp1UcdBEjWQixB+sIBhZaw+q/nDQAEJj q4pvKoU4E7a/t27JWTXbOnAMTgHBiG4t3AU4A0uzXhM2Xnp/Mokgi/gIj3NK4w0YWPdE lU4BNeQ9UGBw+vghtmMWIrAb+lztqFJwslyB1RwCRYKXXympPpQ4XyHJkYQ5PwbGG25F hc8g2wmrXM/zvUucpasM3PPh7YmBsxx8kwOjUcgRY1GjIBBQGDU4npizVFXPZC0+tZsg IuWw== X-Gm-Message-State: AC+VfDzndM0vcb6desWClGeFpcxsG30VwxQ1/mRHSm2P1zbOaEopQ5em fVwyQFKsLbqMTghSFgvkKcwgSYKqn7lHo8yqGsCe3A== X-Received: by 2002:a05:600c:208:b0:3f6:389:73b1 with SMTP id 8-20020a05600c020800b003f6038973b1mr4417401wmi.6.1684829307502; Tue, 23 May 2023 01:08:27 -0700 (PDT) Received: from poulhies-Precision-5550.telnowedge.local (lmontsouris-659-1-24-67.w81-250.abo.wanadoo.fr. [81.250.175.67]) by smtp.gmail.com with ESMTPSA id f15-20020a7bcd0f000000b003f0aefcc457sm13969876wmj.45.2023.05.23.01.08.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 May 2023 01:08:26 -0700 (PDT) To: gcc-patches@gcc.gnu.org Cc: Eric Botcazou Subject: [COMMITTED] ada: Remove the body of System.Storage_Elements Date: Tue, 23 May 2023 10:08:26 +0200 Message-Id: <20230523080826.1873735-1-poulhies@adacore.com> X-Mailer: git-send-email 2.40.0 MIME-Version: 1.0 X-Spam-Status: No, score=-13.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_ASCII_DIVIDERS, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: =?utf-8?q?Marc_Poulhi=C3=A8s_via_Gcc-patches?= From: =?utf-8?q?Marc_Poulhi=C3=A8s?= Reply-To: =?utf-8?q?Marc_Poulhi=C3=A8s?= Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766672872944896703?= X-GMAIL-MSGID: =?utf-8?q?1766672872944896703?= From: Eric Botcazou All the subprograms declared in the unit have convention Intrinsic and their current implementation makes some implicit assumptions that are not valid universally, so it is replaced by a direct expansion. This is mostly straightforward because Resolve_Intrinsic_Operator already contains the required circuitry, but a few adjustements are necessary. gcc/ada/ * exp_ch4.adb (Expand_N_Op_Mod): Deal with the special mod operator of System.Storage_Elements. * exp_intr.adb (Expand_To_Integer): New procedure. (Expand_Intrinsic_Call): Call Expand_To_Integer appropriately. (Expand_To_Address): Deal with an argument with modular type. * sem_ch3.adb (Derive_Subprogram): Also set convention Intrinsic on a derived intrinsic subprogram. * sem_res.adb (Resolve_Arithmetic_Op): Deal with intrinsic operators not coming from source exactly as those coming from source and also generate a reference in both cases. (Resolve_Op_Expon): Likewise. (Resolve_Intrinsic_Operator): Call Implementation_Base_Type to get a nonprivate base type. * snames.ads-tmpl (Name_To_Integer): New intrinsic name. * libgnat/s-stoele.ads: Replace pragma Convention with pragma Import throughout and remove pragma Inline_Always and Pure_Function. * libgnat/s-stoele.adb: Replace entire contents with pragma No_Body. * libgnat/s-atacco.adb: Adjust comment about pragma No_Body. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/exp_ch4.adb | 28 +++++++++- gcc/ada/exp_intr.adb | 27 ++++++++++ gcc/ada/libgnat/s-atacco.adb | 6 +-- gcc/ada/libgnat/s-stoele.adb | 101 ++--------------------------------- gcc/ada/libgnat/s-stoele.ads | 36 +++---------- gcc/ada/sem_ch3.adb | 1 + gcc/ada/sem_res.adb | 10 ++-- gcc/ada/snames.ads-tmpl | 3 +- 8 files changed, 75 insertions(+), 137 deletions(-) diff --git a/gcc/ada/exp_ch4.adb b/gcc/ada/exp_ch4.adb index 70e779d0406..c974a9e8d44 100644 --- a/gcc/ada/exp_ch4.adb +++ b/gcc/ada/exp_ch4.adb @@ -9560,6 +9560,12 @@ package body Exp_Ch4 is Typ : constant Entity_Id := Etype (N); DDC : constant Boolean := Do_Division_Check (N); + Is_Stoele_Mod : constant Boolean := + Is_RTE (First_Subtype (Typ), RE_Storage_Offset) + and then Nkind (Left_Opnd (N)) = N_Unchecked_Type_Conversion + and then Is_RTE (Etype (Expression (Left_Opnd (N))), RE_Address); + -- True if this is the special mod operator of System.Storage_Elements + Left : Node_Id; Right : Node_Id; @@ -9593,7 +9599,10 @@ package body Exp_Ch4 is end if; end if; - if Is_Integer_Type (Typ) then + -- For the special mod operator of System.Storage_Elements, the checks + -- are subsumed into the handling of the negative case below. + + if Is_Integer_Type (Typ) and then not Is_Stoele_Mod then Apply_Divide_Checks (N); -- All done if we don't have a MOD any more, which can happen as a @@ -9663,6 +9672,23 @@ package body Exp_Ch4 is return; end if; + -- The negative case makes no sense since it is a case of a mod where + -- the left argument is unsigned and the right argument is signed. In + -- accordance with the (spirit of the) permission of RM 13.7.1(16), + -- we raise CE, and also include the zero case here. Yes, the RM says + -- PE, but this really is so obviously more like a constraint error. + + if Is_Stoele_Mod and then (not ROK or else Rlo <= 0) then + Insert_Action (N, + Make_Raise_Constraint_Error (Loc, + Condition => + Make_Op_Le (Loc, + Left_Opnd => Duplicate_Subexpr_No_Checks (Right), + Right_Opnd => Make_Integer_Literal (Loc, 0)), + Reason => CE_Overflow_Check_Failed)); + return; + end if; + -- If we still have a mod operator and we are in Modify_Tree_For_C -- mode, and we have a signed integer type, then here is where we do -- the rewrite in terms of Rem. Note this rewrite bypasses the need diff --git a/gcc/ada/exp_intr.adb b/gcc/ada/exp_intr.adb index a1e55882391..2eee892605e 100644 --- a/gcc/ada/exp_intr.adb +++ b/gcc/ada/exp_intr.adb @@ -102,6 +102,12 @@ package body Exp_Intr is -- N_Free_Statement and appropriate context. procedure Expand_To_Address (N : Node_Id); + -- Expand a call to corresponding function from System.Storage_Elements or + -- declared in an instance of System.Address_To_Access_Conversions. + + procedure Expand_To_Integer (N : Node_Id); + -- Expand a call to corresponding function from System.Storage_Elements + procedure Expand_To_Pointer (N : Node_Id); -- Expand a call to corresponding function, declared in an instance of -- System.Address_To_Access_Conversions. @@ -708,6 +714,9 @@ package body Exp_Intr is elsif Nam = Name_To_Address then Expand_To_Address (N); + elsif Nam = Name_To_Integer then + Expand_To_Integer (N); + elsif Nam = Name_To_Pointer then Expand_To_Pointer (N); @@ -1356,6 +1365,12 @@ package body Exp_Intr is Obj : Node_Id; begin + if Is_Modular_Integer_Type (Etype (Arg)) then + Rewrite (N, Unchecked_Convert_To (Etype (N), Arg)); + Analyze (N); + return; + end if; + Remove_Side_Effects (Arg); Obj := Make_Explicit_Dereference (Loc, Relocate_Node (Arg)); @@ -1374,6 +1389,18 @@ package body Exp_Intr is Analyze_And_Resolve (N, RTE (RE_Address)); end Expand_To_Address; + ----------------------- + -- Expand_To_Integer -- + ----------------------- + + procedure Expand_To_Integer (N : Node_Id) is + Arg : constant Node_Id := First_Actual (N); + + begin + Rewrite (N, Unchecked_Convert_To (Etype (N), Arg)); + Analyze (N); + end Expand_To_Integer; + ----------------------- -- Expand_To_Pointer -- ----------------------- diff --git a/gcc/ada/libgnat/s-atacco.adb b/gcc/ada/libgnat/s-atacco.adb index a98b25ce184..8c10681ac0c 100644 --- a/gcc/ada/libgnat/s-atacco.adb +++ b/gcc/ada/libgnat/s-atacco.adb @@ -29,8 +29,8 @@ -- -- ------------------------------------------------------------------------------ --- This package does not require a body, since it is a package renaming. We --- provide a dummy file containing a No_Body pragma so that previous versions --- of the body (which did exist) will not interfere. +-- This package does not require a body. We provide a dummy file containing a +-- No_Body pragma so that previous versions of the body (which did exist) will +-- not interfere. pragma No_Body; diff --git a/gcc/ada/libgnat/s-stoele.adb b/gcc/ada/libgnat/s-stoele.adb index e029f510468..dfd1ba36601 100644 --- a/gcc/ada/libgnat/s-stoele.adb +++ b/gcc/ada/libgnat/s-stoele.adb @@ -29,101 +29,8 @@ -- -- ------------------------------------------------------------------------------ -with Ada.Unchecked_Conversion; +-- This package does not require a body. We provide a dummy file containing a +-- No_Body pragma so that previous versions of the body (which did exist) will +-- not interfere. -package body System.Storage_Elements is - - pragma Suppress (All_Checks); - - -- Conversion to/from address - - -- Note qualification below of To_Address to avoid ambiguities systems - -- where Address is a visible integer type. - - function To_Address is - new Ada.Unchecked_Conversion (Storage_Offset, Address); - function To_Offset is - new Ada.Unchecked_Conversion (Address, Storage_Offset); - - -- Conversion to/from integers - - -- These functions must be place first because they are inlined_always - -- and are used and inlined in other subprograms defined in this unit. - - ---------------- - -- To_Address -- - ---------------- - - function To_Address (Value : Integer_Address) return Address is - begin - return Address (Value); - end To_Address; - - ---------------- - -- To_Integer -- - ---------------- - - function To_Integer (Value : Address) return Integer_Address is - begin - return Integer_Address (Value); - end To_Integer; - - -- Address arithmetic - - --------- - -- "+" -- - --------- - - function "+" (Left : Address; Right : Storage_Offset) return Address is - begin - return Storage_Elements.To_Address - (To_Integer (Left) + To_Integer (To_Address (Right))); - end "+"; - - function "+" (Left : Storage_Offset; Right : Address) return Address is - begin - return Storage_Elements.To_Address - (To_Integer (To_Address (Left)) + To_Integer (Right)); - end "+"; - - --------- - -- "-" -- - --------- - - function "-" (Left : Address; Right : Storage_Offset) return Address is - begin - return Storage_Elements.To_Address - (To_Integer (Left) - To_Integer (To_Address (Right))); - end "-"; - - function "-" (Left, Right : Address) return Storage_Offset is - begin - return To_Offset (Storage_Elements.To_Address - (To_Integer (Left) - To_Integer (Right))); - end "-"; - - ----------- - -- "mod" -- - ----------- - - function "mod" - (Left : Address; - Right : Storage_Offset) return Storage_Offset - is - begin - if Right > 0 then - return Storage_Offset - (To_Integer (Left) mod Integer_Address (Right)); - - -- The negative case makes no sense since it is a case of a mod where - -- the left argument is unsigned and the right argument is signed. In - -- accordance with the (spirit of the) permission of RM 13.7.1(16), - -- we raise CE, and also include the zero case here. Yes, the RM says - -- PE, but this really is so obviously more like a constraint error. - - else - raise Constraint_Error; - end if; - end "mod"; - -end System.Storage_Elements; +pragma No_Body; diff --git a/gcc/ada/libgnat/s-stoele.ads b/gcc/ada/libgnat/s-stoele.ads index 9fd31e7d030..99a195a1338 100644 --- a/gcc/ada/libgnat/s-stoele.ads +++ b/gcc/ada/libgnat/s-stoele.ads @@ -45,12 +45,6 @@ package System.Storage_Elements is pragma Annotate (GNATprove, Always_Return, Storage_Elements); - -- We also add the pragma Pure_Function to the operations in this package, - -- because otherwise functions with parameters derived from Address are - -- treated as non-pure by the back-end (see exp_ch6.adb). This is because - -- in many cases such a parameter is used to hide read/out access to - -- objects, and it would be unsafe to treat such functions as pure. - type Storage_Offset is range -(2 ** (Integer'(Standard'Address_Size) - 1)) .. +(2 ** (Integer'(Standard'Address_Size) - 1)) - Long_Long_Integer'(1); @@ -73,44 +67,26 @@ package System.Storage_Elements is -- Address arithmetic function "+" (Left : Address; Right : Storage_Offset) return Address; - pragma Convention (Intrinsic, "+"); - pragma Inline_Always ("+"); - pragma Pure_Function ("+"); - function "+" (Left : Storage_Offset; Right : Address) return Address; - pragma Convention (Intrinsic, "+"); - pragma Inline_Always ("+"); - pragma Pure_Function ("+"); + pragma Import (Intrinsic, "+"); function "-" (Left : Address; Right : Storage_Offset) return Address; - pragma Convention (Intrinsic, "-"); - pragma Inline_Always ("-"); - pragma Pure_Function ("-"); - function "-" (Left, Right : Address) return Storage_Offset; - pragma Convention (Intrinsic, "-"); - pragma Inline_Always ("-"); - pragma Pure_Function ("-"); + pragma Import (Intrinsic, "-"); function "mod" (Left : Address; - Right : Storage_Offset) return Storage_Offset; - pragma Convention (Intrinsic, "mod"); - pragma Inline_Always ("mod"); - pragma Pure_Function ("mod"); + Right : Storage_Offset) return Storage_Offset; + pragma Import (Intrinsic, "mod"); -- Conversion to/from integers type Integer_Address is mod Memory_Size; function To_Address (Value : Integer_Address) return Address; - pragma Convention (Intrinsic, To_Address); - pragma Inline_Always (To_Address); - pragma Pure_Function (To_Address); + pragma Import (Intrinsic, To_Address); function To_Integer (Value : Address) return Integer_Address; - pragma Convention (Intrinsic, To_Integer); - pragma Inline_Always (To_Integer); - pragma Pure_Function (To_Integer); + pragma Import (Intrinsic, To_Integer); end System.Storage_Elements; diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb index bace2cf616a..50ccb390363 100644 --- a/gcc/ada/sem_ch3.adb +++ b/gcc/ada/sem_ch3.adb @@ -16206,6 +16206,7 @@ package body Sem_Ch3 is if No (Actual_Subp) then if Is_Intrinsic_Subprogram (Parent_Subp) then + Set_Convention (New_Subp, Convention_Intrinsic); Set_Is_Intrinsic_Subprogram (New_Subp); if Present (Alias (Parent_Subp)) diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb index 365c75041a9..a99bed00118 100644 --- a/gcc/ada/sem_res.adb +++ b/gcc/ada/sem_res.adb @@ -6037,11 +6037,11 @@ package body Sem_Res is -- Start of processing for Resolve_Arithmetic_Op begin - if Comes_From_Source (N) - and then Ekind (Entity (N)) = E_Function + if Ekind (Entity (N)) = E_Function and then Is_Imported (Entity (N)) and then Is_Intrinsic_Subprogram (Entity (N)) then + Generate_Reference (Entity (N), N); Resolve_Intrinsic_Operator (N, Typ); return; @@ -9710,7 +9710,7 @@ package body Sem_Res is -------------------------------- procedure Resolve_Intrinsic_Operator (N : Node_Id; Typ : Entity_Id) is - Btyp : constant Entity_Id := Base_Type (Underlying_Type (Typ)); + Btyp : constant Entity_Id := Implementation_Base_Type (Typ); Op : Entity_Id; Arg1 : Node_Id; Arg2 : Node_Id; @@ -10641,11 +10641,11 @@ package body Sem_Res is end if; end if; - if Comes_From_Source (N) - and then Ekind (Entity (N)) = E_Function + if Ekind (Entity (N)) = E_Function and then Is_Imported (Entity (N)) and then Is_Intrinsic_Subprogram (Entity (N)) then + Generate_Reference (Entity (N), N); Resolve_Intrinsic_Operator (N, Typ); return; end if; diff --git a/gcc/ada/snames.ads-tmpl b/gcc/ada/snames.ads-tmpl index afe7508ac28..cf2efbbbb63 100644 --- a/gcc/ada/snames.ads-tmpl +++ b/gcc/ada/snames.ads-tmpl @@ -1337,9 +1337,10 @@ package Snames is Name_Shift_Right : constant Name_Id := N + $; Name_Shift_Right_Arithmetic : constant Name_Id := N + $; Name_Source_Location : constant Name_Id := N + $; + Name_To_Integer : constant Name_Id := N + $; + Name_To_Pointer : constant Name_Id := N + $; Name_Unchecked_Conversion : constant Name_Id := N + $; Name_Unchecked_Deallocation : constant Name_Id := N + $; - Name_To_Pointer : constant Name_Id := N + $; Last_Intrinsic_Name : constant Name_Id := N + $; -- Names used in processing intrinsic calls