From: Arnaud Charlet Date: Tue, 19 Jan 2021 08:32:24 +0000 (-0500) Subject: [Ada] Fix handling of PATs X-Git-Tag: upstream/12.2.0~8157 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5413faaec7a2f4a9501361aabd6350f858a9b691;p=platform%2Fupstream%2Fgcc.git [Ada] Fix handling of PATs gcc/ada/ * exp_pakd.adb (Expand_Packed_Eq): Fix handling of PATs. --- 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 =>