re PR tree-optimization/18572 (Bus error compiling makegpr.adb on Mac OS X 10.3)
authorAndrew Pinski <pinskia@physics.uc.edu>
Mon, 22 Nov 2004 20:02:16 +0000 (20:02 +0000)
committerAndrew Pinski <pinskia@gcc.gnu.org>
Mon, 22 Nov 2004 20:02:16 +0000 (12:02 -0800)
2004-11-22  Andrew Pinski  <pinskia@physics.uc.edu>

        PR tree-opt/18572
        * tree-sra.c (scalarize_init): Unshare the rhs before gimplifying
        it.

From-SVN: r91024

gcc/ChangeLog
gcc/tree-sra.c

index de1259e1e8638f0da4b44ffb28d39ec79e01f19b..d46e06afd3d87508a80f9af076ef136523ecf8de 100644 (file)
@@ -1,3 +1,9 @@
+2004-11-22  Andrew Pinski  <pinskia@physics.uc.edu>
+
+       PR tree-opt/18572
+       * tree-sra.c (scalarize_init): Unshare the rhs before gimplifying
+       it.
+
 2004-11-22  Richard Henderson  <rth@redhat.com>
 
        * function.c (assign_parm_setup_block): Revert 11-13 change to
index 26ecf2e3401624bb6d361d969c9fa827e72d7373..3cc9261552c394183a46e321e8c425a7b883eeb2 100644 (file)
@@ -1832,6 +1832,8 @@ scalarize_init (struct sra_elt *lhs_elt, tree rhs, block_stmt_iterator *bsi)
   /* 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);
       push_gimplify_context ();
       result = generate_element_init (lhs_elt, rhs, &list);
       pop_gimplify_context (NULL);