aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_ch4.adb
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2019-12-24 09:36:03 +0100
committerPierre-Marie de Rodat <derodat@adacore.com>2020-06-02 04:58:20 -0400
commitfa54f4da74b48a088fb1cef7b7f593d02319d019 (patch)
tree46e552494ee55a6bcc714a1aab1df6d8d97d65c9 /gcc/ada/sem_ch4.adb
parent6a987d785122fb015aac527e927818bdc9975a7b (diff)
downloadgcc-fa54f4da74b48a088fb1cef7b7f593d02319d019.zip
gcc-fa54f4da74b48a088fb1cef7b7f593d02319d019.tar.gz
gcc-fa54f4da74b48a088fb1cef7b7f593d02319d019.tar.bz2
[Ada] Remove degenerate Treat_Fixed_As_Integer mechanism
2020-06-02 Eric Botcazou <ebotcazou@adacore.com> gcc/ada/ * exp_ch4.adb (Expand_N_Op_Divide): Remove code dealing with the Treat_Fixed_As_Integer flag. (Expand_N_Op_Multiply): Likewise. * exp_fixd.adb (Build_Divide): Do the division in an integer type long enough to hold both operands and convert the result to the type of the LHS. Do not set Treat_Fixed_As_Integer. (Build_Multiply): Do not set Treat_Fixed_As_Integer. (Build_Rem): Likewise. * sem_ch4.adb (Analyze_Arithmetic_Op): Remove code dealing with the Treat_Fixed_As_Integer flag. (Check_Arithmetic_Pair): Likewise. * sinfo.ads (Treat_Fixed_As_Integer): Delete. (N_Has_Treat_Fixed_As_Integer): Likewise. (Set_Treat_Fixed_As_Integer): Likewise. * sinfo.adb (Treat_Fixed_As_Integer): Likewise. (Set_Treat_Fixed_As_Integer): Likewise. * sprint.ads (Syntax Extensions): Remove '#' special character. * sprint.adb (Process_TFAI_RR_Flags): Delete. (Sprint_Node_Actual) <N_Op_Divide>: Print '@' manually. <N_Op_Multiply>: Likewise. <N_Op_Mod>: Do not print '#'. <N_Op_Rem>: Likewise.
Diffstat (limited to 'gcc/ada/sem_ch4.adb')
-rw-r--r--gcc/ada/sem_ch4.adb34
1 files changed, 6 insertions, 28 deletions
diff --git a/gcc/ada/sem_ch4.adb b/gcc/ada/sem_ch4.adb
index 6391d83..8ac5e21 100644
--- a/gcc/ada/sem_ch4.adb
+++ b/gcc/ada/sem_ch4.adb
@@ -935,16 +935,8 @@ package body Sem_Ch4 is
if Present (Op_Id) then
if Ekind (Op_Id) = E_Operator then
-
- if Nkind_In (N, N_Op_Divide, N_Op_Mod, N_Op_Multiply, N_Op_Rem)
- and then Treat_Fixed_As_Integer (N)
- then
- null;
- else
- Set_Etype (N, Any_Type);
- Find_Arithmetic_Types (L, R, Op_Id, N);
- end if;
-
+ Set_Etype (N, Any_Type);
+ Find_Arithmetic_Types (L, R, Op_Id, N);
else
Set_Etype (N, Any_Type);
Add_One_Interp (N, Op_Id, Etype (Op_Id));
@@ -5915,25 +5907,15 @@ package body Sem_Ch4 is
if Is_Fixed_Point_Type (T1)
and then (Is_Fixed_Point_Type (T2) or else T2 = Universal_Real)
then
- -- If Treat_Fixed_As_Integer is set then the Etype is already set
- -- and no further processing is required (this is the case of an
- -- operator constructed by Exp_Fixd for a fixed point operation)
- -- Otherwise add one interpretation with universal fixed result
- -- If the operator is given in functional notation, it comes
- -- from source and Fixed_As_Integer cannot apply.
-
- if (Nkind (N) not in N_Op
- or else not Treat_Fixed_As_Integer (N))
- and then
- (not Has_Fixed_Op (T1, Op_Id)
- or else Nkind (Parent (N)) = N_Type_Conversion)
+ -- Add one interpretation with universal fixed result
+
+ if not Has_Fixed_Op (T1, Op_Id)
+ or else Nkind (Parent (N)) = N_Type_Conversion
then
Add_One_Interp (N, Op_Id, Universal_Fixed);
end if;
elsif Is_Fixed_Point_Type (T2)
- and then (Nkind (N) not in N_Op
- or else not Treat_Fixed_As_Integer (N))
and then T1 = Universal_Real
and then
(not Has_Fixed_Op (T1, Op_Id)
@@ -5985,10 +5967,6 @@ package body Sem_Ch4 is
elsif Op_Name = Name_Op_Mod or else Op_Name = Name_Op_Rem then
- -- Note: The fixed-point operands case with Treat_Fixed_As_Integer
- -- set does not require any special processing, since the Etype is
- -- already set (case of operation constructed by Exp_Fixed).
-
if Is_Integer_Type (T1)
and then (Covers (T1 => T1, T2 => T2)
or else