diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2010-04-12 10:00:13 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2010-04-12 10:00:13 +0000 |
commit | 675c873bfe795ff94288f31c2735254443d3754b (patch) | |
tree | 47f2f8e659d1353465936d33a9982cdbaddb3f3b /gcc/gimplify.c | |
parent | 3fc20697523443ed885f701923160ea22a19be62 (diff) | |
download | gcc-675c873bfe795ff94288f31c2735254443d3754b.zip gcc-675c873bfe795ff94288f31c2735254443d3754b.tar.gz gcc-675c873bfe795ff94288f31c2735254443d3754b.tar.bz2 |
expr.c (categorize_ctor_elements_1): Properly count sub-elements of non-constant aggregate elements.
* expr.c (categorize_ctor_elements_1): Properly count sub-elements of
non-constant aggregate elements.
* gimplify.c (gimplify_init_constructor): Do not pre-evaluate if this
is a real initialization.
From-SVN: r158219
Diffstat (limited to 'gcc/gimplify.c')
-rw-r--r-- | gcc/gimplify.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gcc/gimplify.c b/gcc/gimplify.c index bfe82dd6..a9eed84 100644 --- a/gcc/gimplify.c +++ b/gcc/gimplify.c @@ -3793,10 +3793,10 @@ gimplify_init_constructor (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p, if (notify_temp_creation) return GS_OK; - /* If there are nonzero elements, pre-evaluate to capture elements - overlapping with the lhs into temporaries. We must do this before - clearing to fetch the values before they are zeroed-out. */ - if (num_nonzero_elements > 0) + /* If there are nonzero elements and if needed, pre-evaluate to capture + elements overlapping with the lhs into temporaries. We must do this + before clearing to fetch the values before they are zeroed-out. */ + if (num_nonzero_elements > 0 && TREE_CODE (*expr_p) != INIT_EXPR) { preeval_data.lhs_base_decl = get_base_address (object); if (!DECL_P (preeval_data.lhs_base_decl)) |