aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2020-08-04 15:08:56 +0200
committerPierre-Marie de Rodat <derodat@adacore.com>2020-10-21 03:22:46 -0400
commit5ff5f7210f74f3190ec50b526a0dfb5be462b28b (patch)
tree4dfed7cef6de4a3a80060fbfc98ccd4428a7e059
parent948c6d7e9e60ef8e1324bfed6d8d937112bef53d (diff)
downloadgcc-5ff5f7210f74f3190ec50b526a0dfb5be462b28b.zip
gcc-5ff5f7210f74f3190ec50b526a0dfb5be462b28b.tar.gz
gcc-5ff5f7210f74f3190ec50b526a0dfb5be462b28b.tar.bz2
[Ada] Fix bogus error for bit-packed array with volatile component
gcc/ada/ * freeze.adb (Check_Strict_Alignment): Do not set the flag for a bit-packed array type, even if it is a by-reference type.
-rw-r--r--gcc/ada/freeze.adb5
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/ada/freeze.adb b/gcc/ada/freeze.adb
index f090b3e..08c78a3 100644
--- a/gcc/ada/freeze.adb
+++ b/gcc/ada/freeze.adb
@@ -1609,7 +1609,10 @@ package body Freeze is
Comp : Entity_Id;
begin
- if Is_By_Reference_Type (E) then
+ -- Bit-packed array types do not require strict alignment, even if they
+ -- are by-reference types, because they are accessed in a special way.
+
+ if Is_By_Reference_Type (E) and then not Is_Bit_Packed_Array (E) then
Set_Strict_Alignment (E);
elsif Is_Array_Type (E) then