comp.lang.ada
 help / color / mirror / Atom feed
* Elaboration code, aggregates
@ 2021-03-28 19:41 Simon Wright
  2021-03-29 15:24 ` Luke A. Guest
  2021-03-30  7:08 ` Simon Wright
  0 siblings, 2 replies; 8+ messages in thread
From: Simon Wright @ 2021-03-28 19:41 UTC (permalink / raw)


In June 2020, Luke A. Guest was having trouble with getting the compiler
to place constant data into the data section without elaboration code.
https://groups.google.com/g/comp.lang.ada/c/B2NA-qjCJuM/m/4ykywZWZAgAJ

During preliminary work for FSF GCC 11, I found that this ARM interrupt
vector (which used to compile happily without needing elaboration code)
no longer would:
https://github.com/simonjwright/cortex-gnat-rts/blob/master/stm32f4/adainclude/startup.adb#L231

   Vectors : array (-14 .. Ada.Interrupts.Names.FPU_IRQ) of Handler :=
     (-9 .. -6 | -4 .. -3 => null,                      -- reserved
      -14                 => Dummy_Handler'Access,      -- NMI
      -13                 => HardFault_Handler'Access,  -- HardFault
      -12                 => Dummy_Handler'Access,      -- MemManagement
      -11                 => Dummy_Handler'Access,      -- BusFault
      -10                 => Dummy_Handler'Access,      -- UsageFault
      -5                  => SVC_Handler'Access,        -- SVCall
      -2                  => PendSV_Handler'Access,     -- PendSV
      -1                  => SysTick_Handler'Access,    -- SysTick
      others              => IRQ_Handler'Access)
     with
       Export,
       Convention         => Ada,
       External_Name      => "isr_vector";
   pragma Linker_Section (Vectors, ".isr_vector");

and Arduino Due clock startup ddn't:
https://github.com/simonjwright/cortex-gnat-rts/blob/master/arduino-due/adainclude/startup-set_up_clock.adb#L48

   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   => <>);

On investigating, it turns out that FSF GCC 11 **AND** GNAT CE 2020 have
lost the ability to assign aggregates as a whole; instead, they assign
the record components one-by-one.

The reason for the Arduino Due failure is that the PMC hardware requires
that each write to the CKGR_MOR register contain that value of KEY! so
the sequence is

read the register (KEY is always returned as 0)
overwrite the KEY field
write the register back
read the register, KEY is 0
overwrite the MOSCXTEN field
write the register back, KEY is 0 so inoperative
etc (including the 'others => <>' components).

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

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

* Re: Elaboration code, aggregates
  2021-03-28 19:41 Elaboration code, aggregates Simon Wright
@ 2021-03-29 15:24 ` Luke A. Guest
  2021-03-29 16:31   ` Niklas Holsti
  2021-03-30  7:08 ` Simon Wright
  1 sibling, 1 reply; 8+ messages in thread
From: Luke A. Guest @ 2021-03-29 15:24 UTC (permalink / raw)



On 28/03/2021 20:41, Simon Wright wrote:
> In June 2020, Luke A. Guest was having trouble with getting the compiler
> to place constant data into the data section without elaboration code.
> https://groups.google.com/g/comp.lang.ada/c/B2NA-qjCJuM/m/4ykywZWZAgAJ
> 

> Bug report raised:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99802
> 

Ooh, the tumble weeds. ;)

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

* Re: Elaboration code, aggregates
  2021-03-29 15:24 ` Luke A. Guest
@ 2021-03-29 16:31   ` Niklas Holsti
  2021-03-29 16:34     ` Luke A. Guest
                       ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Niklas Holsti @ 2021-03-29 16:31 UTC (permalink / raw)


On 2021-03-29 18:24, Luke A. Guest wrote:
> 
> On 28/03/2021 20:41, Simon Wright wrote:
>> In June 2020, Luke A. Guest was having trouble with getting the compiler
>> to place constant data into the data section without elaboration code.
>> https://groups.google.com/g/comp.lang.ada/c/B2NA-qjCJuM/m/4ykywZWZAgAJ
>>
> 
>> Bug report raised:
>> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99802
>>
> 
> Ooh, the tumble weeds. ;)

(emoticon "bafflement") Your meaning, dear sir?

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

* Re: Elaboration code, aggregates
  2021-03-29 16:31   ` Niklas Holsti
@ 2021-03-29 16:34     ` Luke A. Guest
  2021-03-29 18:49     ` Andreas ZEURCHER
  2021-03-29 19:15     ` Paul Rubin
  2 siblings, 0 replies; 8+ messages in thread
From: Luke A. Guest @ 2021-03-29 16:34 UTC (permalink / raw)


On 29/03/2021 17:31, Niklas Holsti wrote:

>> Ooh, the tumble weeds. ;)
> 
> (emoticon "bafflement") Your meaning, dear sir?

https://media.tenor.com/images/2997ba6c067e84a45ffc4eccac614c82/tenor.gif

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

* Re: Elaboration code, aggregates
  2021-03-29 16:31   ` Niklas Holsti
  2021-03-29 16:34     ` Luke A. Guest
@ 2021-03-29 18:49     ` Andreas ZEURCHER
  2021-03-29 19:03       ` Simon Wright
  2021-03-29 19:15     ` Paul Rubin
  2 siblings, 1 reply; 8+ messages in thread
From: Andreas ZEURCHER @ 2021-03-29 18:49 UTC (permalink / raw)


On Monday, March 29, 2021 at 11:31:03 AM UTC-5, Niklas Holsti wrote:
> On 2021-03-29 18:24, Luke A. Guest wrote: 
> > 
> > On 28/03/2021 20:41, Simon Wright wrote: 
> >> In June 2020, Luke A. Guest was having trouble with getting the compiler 
> >> to place constant data into the data section without elaboration code. 
> >> https://groups.google.com/g/comp.lang.ada/c/B2NA-qjCJuM/m/4ykywZWZAgAJ 
> >> 
> > 
> >> Bug report raised: 
> >> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99802 
> >> 
> > 
> > Ooh, the tumble weeds. ;)
> (emoticon "bafflement") Your meaning, dear sir?

Turn-around time from submission to general-availability released fix can be quite long in FSF GNAT or Community Edition.  (Paid-support for GNAT Pro at AdaCore can be more prompt, I hear.)

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

* Re: Elaboration code, aggregates
  2021-03-29 18:49     ` Andreas ZEURCHER
@ 2021-03-29 19:03       ` Simon Wright
  0 siblings, 0 replies; 8+ messages in thread
From: Simon Wright @ 2021-03-29 19:03 UTC (permalink / raw)


Andreas ZEURCHER <ZUERCHER_Andreas@outlook.com> writes:

> On Monday, March 29, 2021 at 11:31:03 AM UTC-5, Niklas Holsti wrote:
>> On 2021-03-29 18:24, Luke A. Guest wrote: 
>> > 
>> > On 28/03/2021 20:41, Simon Wright wrote: 
>> >> In June 2020, Luke A. Guest was having trouble with getting the compiler 
>> >> to place constant data into the data section without elaboration code. 
>> >> https://groups.google.com/g/comp.lang.ada/c/B2NA-qjCJuM/m/4ykywZWZAgAJ 
>> >> 
>> > 
>> >> Bug report raised: 
>> >> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99802 
>> >> 
>> > 
>> > Ooh, the tumble weeds. ;)
>> (emoticon "bafflement") Your meaning, dear sir?
>
> Turn-around time from submission to general-availability released fix
> can be quite long in FSF GNAT or Community Edition.  (Paid-support for
> GNAT Pro at AdaCore can be more prompt, I hear.)

Maybe, but this is accepted as a regression and Eric is on it!
:impressed:

Paid support can be very prompt. We were at the stage where our Systems
Engineer couldn't accept a compiler change, so wavefronts wouldn't have
helped, but workrounds were indeed prompt.

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

* Re: Elaboration code, aggregates
  2021-03-29 16:31   ` Niklas Holsti
  2021-03-29 16:34     ` Luke A. Guest
  2021-03-29 18:49     ` Andreas ZEURCHER
@ 2021-03-29 19:15     ` Paul Rubin
  2 siblings, 0 replies; 8+ messages in thread
From: Paul Rubin @ 2021-03-29 19:15 UTC (permalink / raw)


Niklas Holsti <niklas.holsti@tidorum.invalid> writes:
>> Ooh, the tumble weeds. ;)
> (emoticon "bafflement") Your meaning, dear sir?

It's a metaphor.  Tumbleweeds are balls of plant matter that blow around
in the desert.  If all you can hear is tumbleweeds, that's means nobody
is there to observe or respond.

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

* Re: Elaboration code, aggregates
  2021-03-28 19:41 Elaboration code, aggregates Simon Wright
  2021-03-29 15:24 ` Luke A. Guest
@ 2021-03-30  7:08 ` Simon Wright
  1 sibling, 0 replies; 8+ messages in thread
From: Simon Wright @ 2021-03-30  7:08 UTC (permalink / raw)


Simon Wright <simon@pushface.org> writes:

> Bug report raised:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99802

Now fixed on GCC mainline.

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

end of thread, other threads:[~2021-03-30  7:08 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-28 19:41 Elaboration code, aggregates Simon Wright
2021-03-29 15:24 ` Luke A. Guest
2021-03-29 16:31   ` Niklas Holsti
2021-03-29 16:34     ` Luke A. Guest
2021-03-29 18:49     ` Andreas ZEURCHER
2021-03-29 19:03       ` Simon Wright
2021-03-29 19:15     ` Paul Rubin
2021-03-30  7:08 ` Simon Wright

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox