gcc/
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 2 Jan 2008 13:04:11 +0000 (13:04 +0000)
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 2 Jan 2008 13:04:11 +0000 (13:04 +0000)
* tree-sra.c (scalarize_init): Insert the generate_element_init
statements after the generate_element_zero statements.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@131258 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/tree-sra.c

index 490dc74..803461c 100644 (file)
@@ -1,3 +1,8 @@
+2008-01-02  Richard Sandiford  <rsandifo@nildram.co.uk>
+
+       * tree-sra.c (scalarize_init): Insert the generate_element_init
+       statements after the generate_element_zero statements.
+
 2008-01-02  Richard Guenther  <rguenther@suse.de>
 
        PR middle-end/34093
index 83c5d8a..9128677 100644 (file)
@@ -3354,19 +3354,20 @@ static void
 scalarize_init (struct sra_elt *lhs_elt, tree rhs, block_stmt_iterator *bsi)
 {
   bool result = true;
-  tree list = NULL;
+  tree list = NULL, init_list = NULL;
 
   /* Generate initialization statements for all members extant in the RHS.  */
   if (rhs)
     {
       /* Unshare the expression just in case this is from a decl's initial.  */
       rhs = unshare_expr (rhs);
-      result = generate_element_init (lhs_elt, rhs, &list);
+      result = generate_element_init (lhs_elt, rhs, &init_list);
     }
 
   /* CONSTRUCTOR is defined such that any member not mentioned is assigned
      a zero value.  Initialize the rest of the instantiated elements.  */
   generate_element_zero (lhs_elt, &list);
+  append_to_statement_list (init_list, &list);
 
   if (!result)
     {