decl.c (gnat_to_gnu_entity): Do not create a new TYPE_DECL when a type is padded...
authorEric Botcazou <ebotcazou@adacore.com>
Wed, 21 Oct 2009 10:12:55 +0000 (10:12 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Wed, 21 Oct 2009 10:12:55 +0000 (10:12 +0000)
* gcc-interfaces/decl.c (gnat_to_gnu_entity): Do not create a new
TYPE_DECL when a type is padded if there is already one and reset
TYPE_STUB_DECL in this case.

From-SVN: r153053

gcc/ada/ChangeLog
gcc/ada/gcc-interface/decl.c

index 6fef8cc453a5d661b4c0b6c8d5cd83d92ae5f48d..5d69cee059425b180402975aeedb71f1d18a6417 100644 (file)
@@ -1,3 +1,9 @@
+2009-10-21  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * gcc-interfaces/decl.c (gnat_to_gnu_entity): Do not create a new
+       TYPE_DECL when a type is padded if there is already one and reset
+       TYPE_STUB_DECL in this case.
+
 2009-10-21  Eric Botcazou  <ebotcazou@adacore.com>
 
        * gcc-interfaces/utils.c (create_subprog_decl): Do not redefine
index a2af179817036c07b23759f0b92afba7ca04426a..70ced844fb6af81ef802b4ddff4f32285e844a9e 100644 (file)
@@ -4436,7 +4436,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
         us when we make the new TYPE_DECL below.  */
       if (gnu_size || align > 0)
        gnu_type = maybe_pad_type (gnu_type, gnu_size, align, gnat_entity,
-                                  false, true, definition, false);
+                                  false, !gnu_decl, definition, false);
 
       if (TYPE_IS_PADDING_P (gnu_type))
        {
@@ -4555,7 +4555,10 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
                                     !Comes_From_Source (gnat_entity),
                                     debug_info_p, gnat_entity);
       else
-       TREE_TYPE (gnu_decl) = gnu_type;
+       {
+         TREE_TYPE (gnu_decl) = gnu_type;
+         TYPE_STUB_DECL (gnu_type) = gnu_decl;
+       }
     }
 
   if (is_type && !TYPE_IS_DUMMY_P (TREE_TYPE (gnu_decl)))