aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@adacore.com>2021-01-19 03:32:24 -0500
committerPierre-Marie de Rodat <derodat@adacore.com>2021-05-06 03:51:30 -0400
commit5413faaec7a2f4a9501361aabd6350f858a9b691 (patch)
treea11d1da4cd69408639b8a6a72b176813d1e0c362
parent6068795883e8aacc8b0157e19610d34c0ab11ffa (diff)
downloadgcc-5413faaec7a2f4a9501361aabd6350f858a9b691.zip
gcc-5413faaec7a2f4a9501361aabd6350f858a9b691.tar.gz
gcc-5413faaec7a2f4a9501361aabd6350f858a9b691.tar.bz2
[Ada] Fix handling of PATs
gcc/ada/ * exp_pakd.adb (Expand_Packed_Eq): Fix handling of PATs.
-rw-r--r--gcc/ada/exp_pakd.adb5
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/ada/exp_pakd.adb b/gcc/ada/exp_pakd.adb
index 6ccf237..1dc6af9 100644
--- a/gcc/ada/exp_pakd.adb
+++ b/gcc/ada/exp_pakd.adb
@@ -1909,9 +1909,10 @@ package body Exp_Pakd is
-- where PAT is the packed array type. This works fine, since in the
-- modular case we guarantee that the unused bits are always zeroes.
-- We do have to compare the lengths because we could be comparing
- -- two different subtypes of the same base type.
+ -- two different subtypes of the same base type. We can only do this
+ -- if the PATs on both sides are the same.
- if Is_Modular_Integer_Type (PAT) then
+ if Is_Modular_Integer_Type (PAT) and then PAT = Etype (R) then
Rewrite (N,
Make_And_Then (Loc,
Left_Opnd =>