public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Eric Botcazou <ebotcazou@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r10-10117] [Ada] Fix bogus error for bit-packed array with volatile component
Date: Tue, 14 Sep 2021 07:49:15 +0000 (GMT)	[thread overview]
Message-ID: <20210914074915.D991B3858402@sourceware.org> (raw)

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


                 reply	other threads:[~2021-09-14  7:49 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210914074915.D991B3858402@sourceware.org \
    --to=ebotcazou@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).