+2008-06-26 Olivier Hainque <hainque@adacore.com>
+
+ * gimplify.c (gimplify_modify_expr_to_memset): Assert our
+ documented assumptions.
+
2008-06-26 H.J. Lu <hongjiu.lu@intel.com>
* dwarf2out.c: Remove trailing white spaces. Break long line
static enum gimplify_status
gimplify_modify_expr_to_memset (tree *expr_p, tree size, bool want_value)
{
- tree t, to, to_ptr;
+ tree t, from, to, to_ptr;
+ /* Assert our assumptions, to abort instead of producing wrong code
+ silently if they are not met. Beware that the RHS CONSTRUCTOR might
+ not be immediately exposed. */
+ from = GENERIC_TREE_OPERAND (*expr_p, 1);
+ if (TREE_CODE (from) == WITH_SIZE_EXPR)
+ from = TREE_OPERAND (from, 0);
+
+ gcc_assert (TREE_CODE (from) == CONSTRUCTOR
+ && VEC_empty (constructor_elt, CONSTRUCTOR_ELTS (from)));
+
+ /* Now proceed. */
to = GENERIC_TREE_OPERAND (*expr_p, 0);
to_ptr = build_fold_addr_expr (to);
+2008-06-27 Olivier Hainque <hainque@adacore.com>
+
+ * gnat.dg/aligned_vla.adb: New test.
+
2008-06-26 Joseph Myers <joseph@codesourcery.com>
* gcc.dg/inline-32.c, gcc.dg/inline-32a.c: New tests.
--- /dev/null
+-- { dg-do run }
+
+procedure Aligned_Vla is
+
+ type Table is array (Integer range <>) of Integer;
+ for Table'Alignment use Long_Float'Alignment;
+
+ K : constant := 1;
+ Konstants : Table (1 .. 4) := (others => K);
+
+ procedure Check_Copy (Len : Integer) is
+ My_Konstants : Table (1 .. Len) := Konstants (1 .. 1 + Len - 1);
+ begin
+ for I in My_Konstants'Range loop
+ if My_Konstants (I) /= K then
+ raise Program_Error;
+ end if;
+ end loop;
+ end;
+
+begin
+ Check_Copy (Len => 4);
+end;