re PR ada/36007 (verify_gimple failed)
authorEric Botcazou <ebotcazou@adacore.com>
Mon, 28 Apr 2008 21:15:41 +0000 (21:15 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Mon, 28 Apr 2008 21:15:41 +0000 (21:15 +0000)
PR ada/36007
* decl.c (gnat_to_gnu_entity) <object>: Do not promote alignment
of aliased objects with an unconstrained nominal subtype.
Cap the promotion to the effective alignment of the word mode.

Co-Authored-By: Tristan Gingold <gingold@adacore.com>
From-SVN: r134766

gcc/ada/ChangeLog
gcc/ada/decl.c

index 979ce9014bd392cecb1b82fe1acbb27fa5f15939..b8ac510d6b53cb857809aab39a02032d665afdb2 100644 (file)
@@ -1,3 +1,11 @@
+2008-04-28  Eric Botcazou  <ebotcazou@adacore.com>
+            Tristan Gingold  <gingold@adacore.com>
+
+       PR ada/36007
+       * decl.c (gnat_to_gnu_entity) <object>: Do not promote alignment
+       of aliased objects with an unconstrained nominal subtype.
+       Cap the promotion to the effective alignment of the word mode.
+
 2008-04-28  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
        * Make-lang.in (ada.tags, check-acats, ada/treeprs.ads)
index e60b44348436ae8e409f5709f38afd4a67ce96e6..991faae49e1d79acf95d1e0a07ee6a3652439a5b 100644 (file)
@@ -685,6 +685,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
                    && kind != E_Exception
                    && kind != E_Out_Parameter
                    && Is_Composite_Type (Etype (gnat_entity))
+                   && !Is_Constr_Subt_For_UN_Aliased (Etype (gnat_entity))
                    && !imported_p
                    && No (Renamed_Object (gnat_entity))
                    && No (Address_Clause (gnat_entity))))
@@ -694,7 +695,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
               to support BIGGEST_ALIGNMENT if we don't really have to.  */
            unsigned int align_cap = Is_Atomic (gnat_entity)
                                     ? BIGGEST_ALIGNMENT
-                                    : MAX_FIXED_MODE_SIZE;
+                                    : get_mode_alignment (word_mode);
 
            if (!host_integerp (TYPE_SIZE (gnu_type), 1)
                || compare_tree_int (TYPE_SIZE (gnu_type), align_cap) >= 0)