public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r10-10117] [Ada] Fix bogus error for bit-packed array with volatile component
@ 2021-09-14  7:49 Eric Botcazou
  0 siblings, 0 replies; only message in thread
From: Eric Botcazou @ 2021-09-14  7:49 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:2a4b29cdfd06346f7219bc5d9c21265dd354509f

commit r10-10117-g2a4b29cdfd06346f7219bc5d9c21265dd354509f
Author: Eric Botcazou <ebotcazou@adacore.com>
Date:   Tue Aug 4 15:08:56 2020 +0200

    [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.

Diff:
---
 gcc/ada/freeze.adb | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/gcc/ada/freeze.adb b/gcc/ada/freeze.adb
index 0312ca704aa..458e1b4d3c2 100644
--- a/gcc/ada/freeze.adb
+++ b/gcc/ada/freeze.adb
@@ -1610,7 +1610,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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-09-14  7:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-14  7:49 [gcc r10-10117] [Ada] Fix bogus error for bit-packed array with volatile component Eric Botcazou

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).