aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJavier Miranda <miranda@adacore.com>2019-07-03 08:13:29 +0000
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>2019-07-03 08:13:29 +0000
commit4a51756a8c5536d6f7b9718d7eea39147fcd24d2 (patch)
tree021471b59f53d56c3648ee52d27be1cb36ecc3aa
parent2f6bb511d1003d31ec1213081b6c2514cc10f0f9 (diff)
downloadgcc-4a51756a8c5536d6f7b9718d7eea39147fcd24d2.zip
gcc-4a51756a8c5536d6f7b9718d7eea39147fcd24d2.tar.gz
gcc-4a51756a8c5536d6f7b9718d7eea39147fcd24d2.tar.bz2
[Ada] Exp_Attr: remove dead code
2019-07-03 Javier Miranda <miranda@adacore.com> gcc/ada/ * exp_attr.adb (Expand_Min_Max_Attribute): Code cleanup: removing code that it is now never executed in the CCG compiler (dead code). From-SVN: r272959
-rw-r--r--gcc/ada/ChangeLog6
-rw-r--r--gcc/ada/exp_attr.adb103
2 files changed, 6 insertions, 103 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 12fee98..6754011 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,9 @@
+2019-07-03 Javier Miranda <miranda@adacore.com>
+
+ * exp_attr.adb (Expand_Min_Max_Attribute): Code cleanup:
+ removing code that it is now never executed in the CCG compiler
+ (dead code).
+
2019-07-02 Iain Sandoe <iain@sandoe.co.uk>
* libgnat/system-darwin-ppc.ads: Set Stack_Check_Probes True for
diff --git a/gcc/ada/exp_attr.adb b/gcc/ada/exp_attr.adb
index 97e2671..1e1b2f9 100644
--- a/gcc/ada/exp_attr.adb
+++ b/gcc/ada/exp_attr.adb
@@ -1693,109 +1693,6 @@ package body Exp_Attr is
-- generate conditionals in the code, so check the relevant restriction.
Check_Restriction (No_Implicit_Conditionals, N);
-
- -- In Modify_Tree_For_C mode, we rewrite as an if expression (unless it
- -- is supported).
-
- if Modify_Tree_For_C
- and then not Is_Integer_Type (Etype (N))
- and then not Is_Enumeration_Type (Etype (N))
- and then not Is_Fixed_Point_Type (Etype (N))
- and then not Is_Floating_Point_Type (Etype (N))
- then
- declare
- Loc : constant Source_Ptr := Sloc (N);
- Typ : constant Entity_Id := Etype (N);
- Expr : constant Node_Id := First (Expressions (N));
- Left : constant Node_Id := Relocate_Node (Expr);
- Right : constant Node_Id := Relocate_Node (Next (Expr));
-
- function Make_Compare (Left, Right : Node_Id) return Node_Id;
- -- Returns Left >= Right for Max, Left <= Right for Min
-
- ------------------
- -- Make_Compare --
- ------------------
-
- function Make_Compare (Left, Right : Node_Id) return Node_Id is
- begin
- if Attribute_Name (N) = Name_Max then
- return
- Make_Op_Ge (Loc,
- Left_Opnd => Left,
- Right_Opnd => Right);
- else
- return
- Make_Op_Le (Loc,
- Left_Opnd => Left,
- Right_Opnd => Right);
- end if;
- end Make_Compare;
-
- -- Start of processing for Min_Max
-
- begin
- -- If both Left and Right are side effect free, then we can just
- -- use Duplicate_Expr to duplicate the references and return
-
- -- (if Left >=|<= Right then Left else Right)
-
- if Side_Effect_Free (Left) and then Side_Effect_Free (Right) then
- Rewrite (N,
- Make_If_Expression (Loc,
- Expressions => New_List (
- Make_Compare (Left, Right),
- Duplicate_Subexpr_No_Checks (Left),
- Duplicate_Subexpr_No_Checks (Right))));
-
- -- Otherwise we generate declarations to capture the values.
-
- -- The translation is
-
- -- do
- -- T1 : constant typ := Left;
- -- T2 : constant typ := Right;
- -- in
- -- (if T1 >=|<= T2 then T1 else T2)
- -- end;
-
- else
- declare
- T1 : constant Entity_Id := Make_Temporary (Loc, 'T', Left);
- T2 : constant Entity_Id := Make_Temporary (Loc, 'T', Right);
-
- begin
- Rewrite (N,
- Make_Expression_With_Actions (Loc,
- Actions => New_List (
- Make_Object_Declaration (Loc,
- Defining_Identifier => T1,
- Constant_Present => True,
- Object_Definition =>
- New_Occurrence_Of (Etype (Left), Loc),
- Expression => Relocate_Node (Left)),
-
- Make_Object_Declaration (Loc,
- Defining_Identifier => T2,
- Constant_Present => True,
- Object_Definition =>
- New_Occurrence_Of (Etype (Right), Loc),
- Expression => Relocate_Node (Right))),
-
- Expression =>
- Make_If_Expression (Loc,
- Expressions => New_List (
- Make_Compare
- (New_Occurrence_Of (T1, Loc),
- New_Occurrence_Of (T2, Loc)),
- New_Occurrence_Of (T1, Loc),
- New_Occurrence_Of (T2, Loc)))));
- end;
- end if;
-
- Analyze_And_Resolve (N, Typ);
- end;
- end if;
end Expand_Min_Max_Attribute;
----------------------------------