This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Ada] Housekeeping work in gigi (17/n)
- From: Eric Botcazou <ebotcazou at adacore dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Fri, 2 Oct 2009 22:19:56 +0200
- Subject: Re: [Ada] Housekeeping work in gigi (17/n)
- References: <200909291316.32979.ebotcazou@adacore.com>
> 2009-09-29 Eric Botcazou <ebotcazou@adacore.com>
>
> * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Array_Type>: Factor out
> common code processing the component type into...
> <E_Array_Subtype>: Likewise.
> (gnat_to_gnu_component_type): ...this new static function.
> (maybe_pad_type): Minor cleanup.
This requires the following small adjustment.
Tested on i586-suse-linux, applied on the mainline.
2009-10-02 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/decl.c (check_ok_for_atomic): Do nothing if the type
doesn't come from source.
2009-10-02 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/atomic2.adb: New test.
--
Eric Botcazou
Index: gcc-interface/decl.c
===================================================================
--- gcc-interface/decl.c (revision 152417)
+++ gcc-interface/decl.c (working copy)
@@ -7868,6 +7868,11 @@ check_ok_for_atomic (tree object, Entity
OBJECT is either a type or a decl. */
if (TYPE_P (object))
{
+ /* If this is an anonymous base type, nothing to check. Error will be
+ reported on the source type. */
+ if (!Comes_From_Source (gnat_entity))
+ return;
+
mode = TYPE_MODE (object);
align = TYPE_ALIGN (object);
size = TYPE_SIZE (object);
-- { dg-do compile }
procedure Atomic2 is
type Big is array (1..4) of Integer;
type Arr is array (1..10) of Big;
pragma Atomic_Components (Arr); -- { dg-warning "cannot be guaranteed" }
begin
null;
end;