summaryrefslogtreecommitdiff
path: root/gcc/gimplify.c
diff options
context:
space:
mode:
authorhainque <hainque@138bc75d-0d04-0410-961f-82ee72b054a4>2008-06-27 07:35:33 +0000
committerhainque <hainque@138bc75d-0d04-0410-961f-82ee72b054a4>2008-06-27 07:35:33 +0000
commit83402e8d5cb04172596adfb5384ba327355f89b2 (patch)
tree861eda7fc77012eac08e234c6e0cdb115e8e54b0 /gcc/gimplify.c
parent39c7766b0e2bc612494f3d2f0ff6bcf127199fd6 (diff)
downloadgcc-83402e8d5cb04172596adfb5384ba327355f89b2.tar.gz
2008-06-26 Olivier Hainque <hainque@adacore.com>
gcc/ * gimplify.c (gimplify_modify_expr_to_memset): Assert our documented assumptions. testsuite/ * gnat.dg/aligned_vla.adb: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@137171 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gimplify.c')
-rw-r--r--gcc/gimplify.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index bf81bb0c09a..799ccbee52c 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -2809,8 +2809,19 @@ gimplify_modify_expr_to_memcpy (tree *expr_p, tree size, bool want_value)
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);