public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug ada/99802] New: [11 regression] Assignment of aggregate done component-by-component
@ 2021-03-28 16:16 simon at pushface dot org
  2021-03-29  7:39 ` [Bug ada/99802] " rguenth at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: simon at pushface dot org @ 2021-03-28 16:16 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99802

            Bug ID: 99802
           Summary: [11 regression] Assignment of aggregate done
                    component-by-component
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ada
          Assignee: unassigned at gcc dot gnu.org
          Reporter: simon at pushface dot org
  Target Milestone: ---

Created attachment 50481
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50481&action=edit
Demonstrator, with output assembler

In arm-eabi-gcc version 11.0.1 20210303 (experimental) (GCC),
assigning an aggregate to a memory-mapped register is performed by
assigning the components of the aggregate one-by-one to the register
rather than as a whole word.
The same bug is present in the x86_64-apple-darwin compiler.

In compiler releases up to & including 10, this was done using a
whole-word assignment.

   with ATSAM3X8E; use ATSAM3X8E;
   with ATSAM3X8E.PMC; use ATSAM3X8E.PMC;
   procedure Clock is
   begin
      PMC_Periph.CKGR_MOR :=
        (KEY      => 16#37#,
         MOSCXTEN => 1,     -- main crystal oscillator enable
         MOSCRCEN => 1,     -- main on-chip rc osc. enable
         MOSCXTST => 8,     -- startup time
         others   => <>);
   end Clock;

The register is a component of a record:

   type PMC_Peripheral is record
      ...
      CKGR_MOR   : aliased CKGR_MOR_Register;
      pragma Volatile_Full_Access (CKGR_MOR);
      ...
   end record
     with Volatile;

with object as so:

   PMC_Periph : aliased PMC_Peripheral
     with Import, Address => PMC_Base;

and the write respects the Volatile_Full_Access *as it writes each
component separately to the register*! This fails, in this case,
because the PMC hardware requires each write to this register to be
accompanied by a valid value of the KEY field.

The attached aggregate_assignment.zip contains Ada source, and the
10.1.0 and 11.0.1 versions of the arm-eabi cortex-m3 assembler output
by -S.

I've tried compiling the source in aggregate_assignment.zip with the
x86_64-apple-darwin compiler, and the same bug seems to be present.

NOTE, this bug is also present in GNAT CE 2020.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug ada/99802] [11 regression] Assignment of aggregate done component-by-component
  2021-03-28 16:16 [Bug ada/99802] New: [11 regression] Assignment of aggregate done component-by-component simon at pushface dot org
@ 2021-03-29  7:39 ` rguenth at gcc dot gnu.org
  2021-03-29 16:58 ` jakub at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-03-29  7:39 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99802

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |wrong-code
   Target Milestone|---                         |11.0

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug ada/99802] [11 regression] Assignment of aggregate done component-by-component
  2021-03-28 16:16 [Bug ada/99802] New: [11 regression] Assignment of aggregate done component-by-component simon at pushface dot org
  2021-03-29  7:39 ` [Bug ada/99802] " rguenth at gcc dot gnu.org
@ 2021-03-29 16:58 ` jakub at gcc dot gnu.org
  2021-03-29 17:32 ` ebotcazou at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-03-29 16:58 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99802

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ebotcazou at gcc dot gnu.org,
                   |                            |jakub at gcc dot gnu.org
           Priority|P3                          |P4

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug ada/99802] [11 regression] Assignment of aggregate done component-by-component
  2021-03-28 16:16 [Bug ada/99802] New: [11 regression] Assignment of aggregate done component-by-component simon at pushface dot org
  2021-03-29  7:39 ` [Bug ada/99802] " rguenth at gcc dot gnu.org
  2021-03-29 16:58 ` jakub at gcc dot gnu.org
@ 2021-03-29 17:32 ` ebotcazou at gcc dot gnu.org
  2021-03-29 17:32 ` [Bug ada/99802] [11 regression] assignment " ebotcazou at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2021-03-29 17:32 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99802

Eric Botcazou <ebotcazou at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2021-03-29
     Ever confirmed|0                           |1

--- Comment #1 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
Confirmed, this was working by chance before.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug ada/99802] [11 regression] assignment of aggregate done component-by-component
  2021-03-28 16:16 [Bug ada/99802] New: [11 regression] Assignment of aggregate done component-by-component simon at pushface dot org
                   ` (2 preceding siblings ...)
  2021-03-29 17:32 ` ebotcazou at gcc dot gnu.org
@ 2021-03-29 17:32 ` ebotcazou at gcc dot gnu.org
  2021-03-29 22:46 ` cvs-commit at gcc dot gnu.org
  2021-03-29 22:47 ` ebotcazou at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2021-03-29 17:32 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99802

Eric Botcazou <ebotcazou at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[11 regression] Assignment  |[11 regression] assignment
                   |of aggregate done           |of aggregate done
                   |component-by-component      |component-by-component
           Assignee|unassigned at gcc dot gnu.org      |ebotcazou at gcc dot gnu.org
             Status|NEW                         |ASSIGNED

--- Comment #2 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
Fixing.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug ada/99802] [11 regression] assignment of aggregate done component-by-component
  2021-03-28 16:16 [Bug ada/99802] New: [11 regression] Assignment of aggregate done component-by-component simon at pushface dot org
                   ` (3 preceding siblings ...)
  2021-03-29 17:32 ` [Bug ada/99802] [11 regression] assignment " ebotcazou at gcc dot gnu.org
@ 2021-03-29 22:46 ` cvs-commit at gcc dot gnu.org
  2021-03-29 22:47 ` ebotcazou at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-03-29 22:46 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99802

--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Eric Botcazou <ebotcazou@gcc.gnu.org>:

https://gcc.gnu.org/g:471babd88668dbe4f9ff4dba6d2036ecef09653b

commit r11-7900-g471babd88668dbe4f9ff4dba6d2036ecef09653b
Author: Eric Botcazou <ebotcazou@adacore.com>
Date:   Tue Mar 30 00:41:46 2021 +0200

    Fix wrong assignment of aggregate to full-access component

    This is a regression present on the mainline: the compiler (front-end)
fails
    to assign an aggregate to a full-access component (i.e. Atomic or VFA) as a
    whole if the type of the component is not full access itself.

    gcc/ada/
            PR ada/99802
            * freeze.adb (Is_Full_Access_Aggregate): Call Is_Full_Access_Object
            on the name of an N_Assignment_Statement to spot full access.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug ada/99802] [11 regression] assignment of aggregate done component-by-component
  2021-03-28 16:16 [Bug ada/99802] New: [11 regression] Assignment of aggregate done component-by-component simon at pushface dot org
                   ` (4 preceding siblings ...)
  2021-03-29 22:46 ` cvs-commit at gcc dot gnu.org
@ 2021-03-29 22:47 ` ebotcazou at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2021-03-29 22:47 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99802

Eric Botcazou <ebotcazou at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #4 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
Thanks for reporting the problem.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-03-29 22:47 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-28 16:16 [Bug ada/99802] New: [11 regression] Assignment of aggregate done component-by-component simon at pushface dot org
2021-03-29  7:39 ` [Bug ada/99802] " rguenth at gcc dot gnu.org
2021-03-29 16:58 ` jakub at gcc dot gnu.org
2021-03-29 17:32 ` ebotcazou at gcc dot gnu.org
2021-03-29 17:32 ` [Bug ada/99802] [11 regression] assignment " ebotcazou at gcc dot gnu.org
2021-03-29 22:46 ` cvs-commit at gcc dot gnu.org
2021-03-29 22:47 ` ebotcazou at gcc dot gnu.org

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