OSDN Git Service

* gcc-interface/decl.c (gnat_to_gnu_entity) <object>: If there is an
authorebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 11 Dec 2011 10:40:08 +0000 (10:40 +0000)
committerebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 11 Dec 2011 10:40:08 +0000 (10:40 +0000)
alignment set on a renaming, assert that the renamed object is aligned
enough as to make it possible to honor it.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@182201 138bc75d-0d04-0410-961f-82ee72b054a4

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

index 495dbf4..e8ce2e6 100644 (file)
@@ -1,5 +1,11 @@
 2011-12-11  Eric Botcazou  <ebotcazou@adacore.com>
 
+       * gcc-interface/decl.c (gnat_to_gnu_entity) <object>: If there is an
+       alignment set on a renaming, assert that the renamed object is aligned
+       enough as to make it possible to honor it.
+
+2011-12-11  Eric Botcazou  <ebotcazou@adacore.com>
+
        * gcc-interface/trans.c (gigi): Initialize the linemap earlier.
 
 2011-12-06  Dave Korn  <dave.korn.cygwin@gmail.com>
index 12971a6..aecbd76 100644 (file)
@@ -1008,6 +1008,17 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
                        saved = true;
                        annotate_object (gnat_entity, gnu_type, NULL_TREE,
                                         false, false);
+                       /* This assertion will fail if the renamed object
+                          isn't aligned enough as to make it possible to
+                          honor the alignment set on the renaming.  */
+                       if (align)
+                         {
+                           unsigned int renamed_align
+                             = DECL_P (gnu_decl)
+                               ? DECL_ALIGN (gnu_decl)
+                               : TYPE_ALIGN (TREE_TYPE (gnu_decl));
+                           gcc_assert (renamed_align >= align);
+                         }
                        break;
                      }