aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/lib-xref.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2011-09-02 11:32:10 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2011-09-02 11:32:10 +0200
commitf2404867dfe7ed85f8a9aff6cf218055ebbb23ae (patch)
treecaef630ef7510b81c5a71c1d4defcfb67cfe67f9 /gcc/ada/lib-xref.adb
parent029b67bac325590fb9557b5964aea6bb2aac0cba (diff)
downloadgcc-f2404867dfe7ed85f8a9aff6cf218055ebbb23ae.zip
gcc-f2404867dfe7ed85f8a9aff6cf218055ebbb23ae.tar.gz
gcc-f2404867dfe7ed85f8a9aff6cf218055ebbb23ae.tar.bz2
[multiple changes]
2011-09-02 Bob Duff <duff@adacore.com> * lib-xref.adb: (Hash): Avoid use of 'Mod attribute, because old compilers don't understand it. 2011-09-02 Gary Dismukes <dismukes@adacore.com> * exp_attr.adb (Expand_N_Attribute_Reference): Pass the underlying subtype rather than its base type on the call to Build_Record_Or_Elementary_Input_Function, so that any constraints on a discriminated subtype will be available for doing the check required by AI05-0192. * exp_strm.adb (Build_Record_Or_Elementary_Input_Function): If the prefix subtype of the 'Input attribute is a constrained discriminated subtype, then check each constrained discriminant value against the corresponding value read from the stream. From-SVN: r178453
Diffstat (limited to 'gcc/ada/lib-xref.adb')
-rw-r--r--gcc/ada/lib-xref.adb6
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/ada/lib-xref.adb b/gcc/ada/lib-xref.adb
index 15edfb6..e8c47d7 100644
--- a/gcc/ada/lib-xref.adb
+++ b/gcc/ada/lib-xref.adb
@@ -1057,7 +1057,11 @@ package body Lib.Xref is
XE : Xref_Entry renames Xrefs.Table (F);
type M is mod 2**32;
- H : constant M := M'Mod (XE.Key.Ent) + 2**7 * M'Mod (XE.Key.Loc);
+
+ H : constant M := M (XE.Key.Ent) + 2**7 * M (abs XE.Key.Loc);
+ -- We can't use M'Mod above, because it prevents bootstrapping with
+ -- older compilers. Loc can be negative, so we do "abs" before
+ -- converting.
begin
return Header_Num (H mod Num_Buckets);
end Hash;