aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/exp_intr.adb
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2021-09-13 10:37:49 -0700
committerIan Lance Taylor <iant@golang.org>2021-09-13 10:37:49 -0700
commite252b51ccde010cbd2a146485d8045103cd99533 (patch)
treee060f101cdc32bf5e520de8e5275db9d4236b74c /gcc/ada/exp_intr.adb
parentf10c7c4596dda99d2ee872c995ae4aeda65adbdf (diff)
parent104c05c5284b7822d770ee51a7d91946c7e56d50 (diff)
downloadgcc-e252b51ccde010cbd2a146485d8045103cd99533.zip
gcc-e252b51ccde010cbd2a146485d8045103cd99533.tar.gz
gcc-e252b51ccde010cbd2a146485d8045103cd99533.tar.bz2
Merge from trunk revision 104c05c5284b7822d770ee51a7d91946c7e56d50.
Diffstat (limited to 'gcc/ada/exp_intr.adb')
-rw-r--r--gcc/ada/exp_intr.adb129
1 files changed, 37 insertions, 92 deletions
diff --git a/gcc/ada/exp_intr.adb b/gcc/ada/exp_intr.adb
index 3be039b..45de0fb 100644
--- a/gcc/ada/exp_intr.adb
+++ b/gcc/ada/exp_intr.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2020, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2021, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -23,38 +23,41 @@
-- --
------------------------------------------------------------------------------
-with Atree; use Atree;
-with Checks; use Checks;
-with Einfo; use Einfo;
-with Elists; use Elists;
-with Expander; use Expander;
-with Exp_Atag; use Exp_Atag;
-with Exp_Ch7; use Exp_Ch7;
-with Exp_Ch11; use Exp_Ch11;
-with Exp_Code; use Exp_Code;
-with Exp_Fixd; use Exp_Fixd;
-with Exp_Util; use Exp_Util;
-with Freeze; use Freeze;
-with Inline; use Inline;
-with Nmake; use Nmake;
-with Nlists; use Nlists;
-with Opt; use Opt;
-with Restrict; use Restrict;
-with Rident; use Rident;
-with Rtsfind; use Rtsfind;
-with Sem; use Sem;
-with Sem_Aux; use Sem_Aux;
-with Sem_Eval; use Sem_Eval;
-with Sem_Res; use Sem_Res;
-with Sem_Type; use Sem_Type;
-with Sem_Util; use Sem_Util;
-with Sinfo; use Sinfo;
-with Sinput; use Sinput;
-with Snames; use Snames;
-with Stand; use Stand;
-with Tbuild; use Tbuild;
-with Uintp; use Uintp;
-with Urealp; use Urealp;
+with Atree; use Atree;
+with Checks; use Checks;
+with Einfo; use Einfo;
+with Einfo.Entities; use Einfo.Entities;
+with Einfo.Utils; use Einfo.Utils;
+with Elists; use Elists;
+with Expander; use Expander;
+with Exp_Atag; use Exp_Atag;
+with Exp_Ch7; use Exp_Ch7;
+with Exp_Ch11; use Exp_Ch11;
+with Exp_Code; use Exp_Code;
+with Exp_Fixd; use Exp_Fixd;
+with Exp_Util; use Exp_Util;
+with Freeze; use Freeze;
+with Inline; use Inline;
+with Nmake; use Nmake;
+with Nlists; use Nlists;
+with Opt; use Opt;
+with Restrict; use Restrict;
+with Rident; use Rident;
+with Rtsfind; use Rtsfind;
+with Sem; use Sem;
+with Sem_Aux; use Sem_Aux;
+with Sem_Eval; use Sem_Eval;
+with Sem_Res; use Sem_Res;
+with Sem_Type; use Sem_Type;
+with Sem_Util; use Sem_Util;
+with Sinfo; use Sinfo;
+with Sinfo.Nodes; use Sinfo.Nodes;
+with Sinfo.Utils; use Sinfo.Utils;
+with Sinput; use Sinput;
+with Snames; use Snames;
+with Stand; use Stand;
+with Tbuild; use Tbuild;
+with Uintp; use Uintp;
package body Exp_Intr is
@@ -66,9 +69,6 @@ package body Exp_Intr is
-- Expand a call to an intrinsic arithmetic operator when the operand
-- types or sizes are not identical.
- procedure Expand_Is_Negative (N : Node_Id);
- -- Expand a call to the intrinsic Is_Negative function
-
procedure Expand_Dispatching_Constructor_Call (N : Node_Id);
-- Expand a call to an instantiation of Generic_Dispatching_Constructor
-- into a dispatching call to the actual subprogram associated with the
@@ -521,7 +521,7 @@ package body Exp_Intr is
if No (Choice_Parameter (P)) then
E := Make_Temporary (Loc, 'E');
Set_Choice_Parameter (P, E);
- Set_Ekind (E, E_Variable);
+ Mutate_Ekind (E, E_Variable);
Set_Etype (E, RTE (RE_Exception_Occurrence));
Set_Scope (E, Current_Scope);
end if;
@@ -636,9 +636,6 @@ package body Exp_Intr is
then
Expand_Import_Call (N);
- elsif Nam = Name_Is_Negative then
- Expand_Is_Negative (N);
-
elsif Nam = Name_Rotate_Left then
Expand_Shift (N, E, N_Op_Rotate_Left);
@@ -696,58 +693,6 @@ package body Exp_Intr is
end if;
end Expand_Intrinsic_Call;
- ------------------------
- -- Expand_Is_Negative --
- ------------------------
-
- procedure Expand_Is_Negative (N : Node_Id) is
- Loc : constant Source_Ptr := Sloc (N);
- Opnd : constant Node_Id := Relocate_Node (First_Actual (N));
-
- begin
-
- -- We replace the function call by the following expression
-
- -- if Opnd < 0.0 then
- -- True
- -- else
- -- if Opnd > 0.0 then
- -- False;
- -- else
- -- Float_Unsigned!(Float (Opnd)) /= 0
- -- end if;
- -- end if;
-
- Rewrite (N,
- Make_If_Expression (Loc,
- Expressions => New_List (
- Make_Op_Lt (Loc,
- Left_Opnd => Duplicate_Subexpr (Opnd),
- Right_Opnd => Make_Real_Literal (Loc, Ureal_0)),
-
- New_Occurrence_Of (Standard_True, Loc),
-
- Make_If_Expression (Loc,
- Expressions => New_List (
- Make_Op_Gt (Loc,
- Left_Opnd => Duplicate_Subexpr_No_Checks (Opnd),
- Right_Opnd => Make_Real_Literal (Loc, Ureal_0)),
-
- New_Occurrence_Of (Standard_False, Loc),
-
- Make_Op_Ne (Loc,
- Left_Opnd =>
- Unchecked_Convert_To
- (RTE (RE_Float_Unsigned),
- Convert_To
- (Standard_Float,
- Duplicate_Subexpr_No_Checks (Opnd))),
- Right_Opnd =>
- Make_Integer_Literal (Loc, 0)))))));
-
- Analyze_And_Resolve (N, Standard_Boolean);
- end Expand_Is_Negative;
-
------------------
-- Expand_Shift --
------------------