From: Javier Miranda Date: Mon, 1 Jul 2019 13:34:45 +0000 (+0000) Subject: [Ada] Disable expansion of 'Min/'Max of floating point types X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=54948285e6267a68d5f08f1d1c09e677abcbb34f;p=gcc.git [Ada] Disable expansion of 'Min/'Max of floating point types 2019-07-01 Javier Miranda 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 --- diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 31fecb6c1d3..7bb2605bf63 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,10 @@ +2019-07-01 Javier Miranda + + * 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 * 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 cbf7db372ff..7d3a6c44586 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);