aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJavier Miranda <miranda@adacore.com>2019-07-01 13:34:45 +0000
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>2019-07-01 13:34:45 +0000
commit54948285e6267a68d5f08f1d1c09e677abcbb34f (patch)
treecc05ab7a4786e390dff2c74c97780e2428473836
parent5a428808e775ed9f52d9ae738b366acdbd361c19 (diff)
downloadgcc-54948285e6267a68d5f08f1d1c09e677abcbb34f.zip
gcc-54948285e6267a68d5f08f1d1c09e677abcbb34f.tar.gz
gcc-54948285e6267a68d5f08f1d1c09e677abcbb34f.tar.bz2
[Ada] Disable expansion of 'Min/'Max of floating point types
2019-07-01 Javier Miranda <miranda@adacore.com> gcc/ada/ * exp_attr.adb (Expand_Min_Max_Attribute): Disable expansion of 'Min/'Max on integer, enumeration, fixed point and floating point types since the CCG backend now provides in file standard.h routines to support it. From-SVN: r272858
-rw-r--r--gcc/ada/ChangeLog7
-rw-r--r--gcc/ada/exp_attr.adb12
2 files changed, 16 insertions, 3 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 31fecb6..7bb2605 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,10 @@
+2019-07-01 Javier Miranda <miranda@adacore.com>
+
+ * exp_attr.adb (Expand_Min_Max_Attribute): Disable expansion of
+ 'Min/'Max on integer, enumeration, fixed point and floating
+ point types since the CCG backend now provides in file
+ standard.h routines to support it.
+
2019-07-01 Hristian Kirtchev <kirtchev@adacore.com>
* impunit.adb: Add GNAT.Graphs to list Non_Imp_File_Names_95.
diff --git a/gcc/ada/exp_attr.adb b/gcc/ada/exp_attr.adb
index cbf7db3..7d3a6c4 100644
--- a/gcc/ada/exp_attr.adb
+++ b/gcc/ada/exp_attr.adb
@@ -1694,9 +1694,15 @@ package body Exp_Attr is
Check_Restriction (No_Implicit_Conditionals, N);
- -- In Modify_Tree_For_C mode, we rewrite as an if expression
-
- if Modify_Tree_For_C then
+ -- 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);