]> gcc.gnu.org Git - gcc.git/blobdiff - gcc/ada/trans.c
sem_res.adb (Resolve_Selected_Component): do not generate a discriminant check if...
[gcc.git] / gcc / ada / trans.c
index 1d6bf9825595b8d15b8bcc3308c9d21d113928ce..9864efa750b2f6b2ca94068310a8bbda1819d841 100644 (file)
@@ -585,9 +585,9 @@ tree_transform (gnat_node)
          else
            {
              if (! Is_Machine_Number (gnat_node))
-               ur_realval =
-                   Machine (Base_Type (Underlying_Type (Etype (gnat_node))),
-                                     ur_realval);
+               ur_realval
+                 = Machine (Base_Type (Underlying_Type (Etype (gnat_node))),
+                            ur_realval, Round_Even);
 
              gnu_result
                = UI_To_gnu (Numerator (ur_realval), gnu_result_type);
@@ -1858,6 +1858,13 @@ tree_transform (gnat_node)
            gnu_rhs = maybe_unconstrained_array (gnu_rhs);
          }
 
+       /* If the result type is a private type, its full view may be a
+          numeric subtype. The representation we need is that of its base
+          type, given that it is the result of an arithmetic operation.  */
+        else if (Is_Private_Type (Etype (gnat_node))) 
+         gnu_type = gnu_result_type
+           = get_unpadded_type (Base_Type (Full_View (Etype (gnat_node))));
+
        /* If this is a shift whose count is not guaranteed to be correct,
           we need to adjust the shift count.  */
        if (IN (Nkind (gnat_node), N_Op_Shift)
This page took 0.032696 seconds and 5 git commands to generate.