]> gcc.gnu.org Git - gcc.git/blobdiff - gcc/ada/exp_attr.adb
Fix PR ada/98230
[gcc.git] / gcc / ada / exp_attr.adb
index cbf7db372ff7a95d13961a40566f7681b9e6a9b8..06a542c912f65a165d7c5c1cc46473952eaa354f 100644 (file)
@@ -4709,13 +4709,15 @@ package body Exp_Attr is
 
       when Attribute_Mod => Mod_Case : declare
          Arg  : constant Node_Id := Relocate_Node (First (Exprs));
-         Hi   : constant Node_Id := Type_High_Bound (Etype (Arg));
+         Hi   : constant Node_Id := Type_High_Bound (Base_Type (Etype (Arg)));
          Modv : constant Uint    := Modulus (Btyp);
 
       begin
 
          --  This is not so simple. The issue is what type to use for the
-         --  computation of the modular value.
+         --  computation of the modular value. In addition we need to use
+         --  the base type as above to retrieve a static bound for the
+         --  comparisons that follow.
 
          --  The easy case is when the modulus value is within the bounds
          --  of the signed integer type of the argument. In this case we can
This page took 0.034946 seconds and 5 git commands to generate.