+2010-04-12 Eric Botcazou <ebotcazou@adacore.com>
+
+ * 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.
+
2010-04-12 Shujing Zhao <pearly.zhao@oracle.com>
PR c/36774
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))
+2010-04-12 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gnat.dg/aggr13.adb: New test.
+ * gnat.dg/aggr14.adb: Likewise.
+ * gnat.dg/aggr14_pkg.ad[sb]: New helper.
+
2010-04-12 Richard Guenther <rguenther@suse.de>
PR c++/43611