[Ada] Pragma Atomic wrongly rejected on composite component
Eric Botcazou
ebotcazou@adacore.com
Sat Sep 9 12:31:00 GMT 2017
The compiler wrongly rejects a pragma Atomic on a component of a record whose
type is composite, but it accepts the pragma on a variable of the same type.
Tested on x86_64-suse-linux, applied on the mainline and 7 branch.
2017-09-09 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/decl.c (promote_object_alignment): New function taken
from...
(gnat_to_gnu_entity) <E_Variable>: ...here. Invoke it.
(gnat_to_gnu_field): If the field is Atomic or VFA, invoke it and
create a padding type on success before doing the atomic check.
2017-09-09 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/specs/atomic3.ads: New test.
--
Eric Botcazou
-------------- next part --------------
A non-text attachment was scrubbed...
Name: atomic3.ads
Type: text/x-adasrc
Size: 773 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20170909/742133f8/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: p.diff
Type: text/x-patch
Size: 4874 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20170909/742133f8/attachment-0001.bin>
More information about the Gcc-patches
mailing list