re PR regression/52020 (ICE in immed_double_const, at emit-rtl.c:544)
authorRichard Guenther <rguenther@suse.de>
Fri, 27 Jan 2012 15:50:32 +0000 (15:50 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Fri, 27 Jan 2012 15:50:32 +0000 (15:50 +0000)
2012-01-27  Richard Guenther  <rguenther@suse.de>

        PR tree-optimization/52020
* tree-sra.c (sra_modify_assign): Do not transform clobbers.

From-SVN: r183633

gcc/ChangeLog
gcc/tree-sra.c

index 60bc0a9ae3b37c5df407939d34c53b23ab02b721..8b2e0c679461ef6db51e7c0a387ea147a326aeed 100644 (file)
@@ -1,3 +1,8 @@
+2012-01-27  Richard Guenther  <rguenther@suse.de>
+
+       PR tree-optimization/52020
+       * tree-sra.c (sra_modify_assign): Do not transform clobbers.
+
 2012-01-27  Richard Guenther  <rguenther@suse.de>
 
        * ipa-pure-const.c (check_stmt): Clobbers do not make a
index fa67e94cca378e8e7b8842a7d94e220b5ffc00f0..675795860d700ec5a1143c1f743f4463f05efec1 100644 (file)
@@ -2836,6 +2836,20 @@ sra_modify_constructor_assign (gimple *stmt, gimple_stmt_iterator *gsi)
   if (!acc)
     return SRA_AM_NONE;
 
+  if (gimple_clobber_p (*stmt))
+    {
+      /* Remove clobbers of fully scalarized variables, otherwise
+        do nothing.  */
+      if (acc->grp_covered)
+       {
+         unlink_stmt_vdef (*stmt);
+         gsi_remove (gsi, true);
+         return SRA_AM_REMOVED;
+       }
+      else
+       return SRA_AM_NONE;
+    }
+
   loc = gimple_location (*stmt);
   if (VEC_length (constructor_elt,
                  CONSTRUCTOR_ELTS (gimple_assign_rhs1 (*stmt))) > 0)