trans.c (gnat_to_gnu): Assert that the type of the prefix is ultimately an array.
authorEric Botcazou <ebotcazou@adacore.com>
Sat, 8 Dec 2012 12:13:44 +0000 (12:13 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Sat, 8 Dec 2012 12:13:44 +0000 (12:13 +0000)
* gcc-interface/trans.c (gnat_to_gnu) <N_Indexed_Component>: Assert
that the type of the prefix is ultimately an array.

From-SVN: r194323

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

index 5a5834fc98e3d5cf255cd01c1cc04ab8c1a440b2..7e1208f0e52931e12985f2b275108fb0f676ad7d 100644 (file)
@@ -1,3 +1,8 @@
+2012-12-08  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * gcc-interface/trans.c (gnat_to_gnu) <N_Indexed_Component>: Assert
+       that the type of the prefix is ultimately an array.
+
 2012-12-08  Eric Botcazou  <ebotcazou@adacore.com>
 
        * gcc-interface/trans.c (Subprogram_Body_to_gnu): Be prepared for a
index f1398e2b6ba452bf3b5bfa39fccc282ccd9d9b77..74133a458b180c411af167b157678c0efbb65fe3 100644 (file)
@@ -5410,6 +5410,10 @@ gnat_to_gnu (Node_Id gnat_node)
 
        gnu_result = gnu_array_object;
 
+       /* The failure of this assertion will very likely come from a missing
+          expansion for a packed array access.  */
+       gcc_assert (TREE_CODE (TREE_TYPE (gnu_array_object)) == ARRAY_TYPE);
+
        /* First compute the number of dimensions of the array, then
           fill the expression array, the order depending on whether
           this is a Convention_Fortran array or not.  */