exp_attr.adb (Is_Inline_Floating_Point_Attribute): Revert to previous state in CodePe...
authorArnaud Charlet <charlet@adacore.com>
Fri, 1 Aug 2014 09:46:10 +0000 (09:46 +0000)
committerArnaud Charlet <charlet@gcc.gnu.org>
Fri, 1 Aug 2014 09:46:10 +0000 (11:46 +0200)
2014-08-01  Arnaud Charlet  <charlet@adacore.com>

* exp_attr.adb (Is_Inline_Floating_Point_Attribute): Revert to
previous state in CodePeer_Mode.

From-SVN: r213435

gcc/ada/ChangeLog
gcc/ada/exp_attr.adb

index 69794aa4006d81eb9a4d52467f6c7135c9bf3431..a9856c838962256a2ac5c8d7f6e5f4894d4c86e6 100644 (file)
@@ -1,3 +1,8 @@
+2014-08-01  Arnaud Charlet  <charlet@adacore.com>
+
+       * exp_attr.adb (Is_Inline_Floating_Point_Attribute): Revert to
+       previous state in CodePeer_Mode.
+
 2014-08-01  Robert Dewar  <dewar@adacore.com>
 
        * hostparm.ads: Put back definition of OpenVMS as False to aid
index fb715ea6d210782d5c937519ffd398e31de09d96..d42018a55b901e6e27a73acb89b7b61f23f9a1ca 100644 (file)
@@ -7955,8 +7955,16 @@ package body Exp_Attr is
       Id : constant Attribute_Id := Get_Attribute_Id (Attribute_Name (N));
 
    begin
+      --  Machine and Model can be expanded by the backend, but in CodePeer
+      --  mode, we prefer the front end to do the expansion, because CodePeer
+      --  is not prepared to handle these attributes.
+
       if Id = Attribute_Machine or else Id = Attribute_Model then
-         return True;
+         return not CodePeer_Mode;
+
+      --  Remaining cases handled by the back end are Rounding and Truncatation
+      --  when appearing as the operand of a conversion to some integer type.
+      --  CodePeer can handle these cases fine.
 
       elsif Nkind (Parent (N)) /= N_Type_Conversion
         or else not Is_Integer_Type (Etype (Parent (N)))
@@ -7964,8 +7972,11 @@ package body Exp_Attr is
          return False;
       end if;
 
-      --  Should also support 'Machine_Rounding and 'Unbiased_Rounding, but
-      --  required back end support has not been implemented yet ???
+      --  Here we are in the integer conversion context
+
+      --  Very probably we should also recognize the cases of Machine_Rounding
+      --  and unbiased rounding in this conversion context, but the back end is
+      --  not yet prepared to handle these cases ???
 
       return Id = Attribute_Rounding or else Id = Attribute_Truncation;
    end Is_Inline_Floating_Point_Attribute;