tree-vect-stmts.c (free_stmt_vec_info): Clear BB and release SSA defs of pattern...
authorRichard Biener <rguenther@suse.de>
Mon, 17 Feb 2014 15:34:03 +0000 (15:34 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Mon, 17 Feb 2014 15:34:03 +0000 (15:34 +0000)
2014-02-17  Richard Biener  <rguenther@suse.de>

* tree-vect-stmts.c (free_stmt_vec_info): Clear BB and
release SSA defs of pattern stmts.

From-SVN: r207826

gcc/ChangeLog
gcc/tree-vect-stmts.c

index dcd4614..c0e3b69 100644 (file)
@@ -1,5 +1,10 @@
 2014-02-17  Richard Biener  <rguenther@suse.de>
 
+       * tree-vect-stmts.c (free_stmt_vec_info): Clear BB and
+       release SSA defs of pattern stmts.
+
+2014-02-17  Richard Biener  <rguenther@suse.de>
+
        * tree-inline.c (expand_call_inline): Release the virtual
        operand defined by the call we are about to inline.
 
index 8ed834b..7e47feb 100644 (file)
@@ -7389,13 +7389,25 @@ free_stmt_vec_info (gimple stmt)
       if (patt_info)
        {
          gimple_seq seq = STMT_VINFO_PATTERN_DEF_SEQ (patt_info);
+         gimple patt_stmt = STMT_VINFO_STMT (patt_info);
+         gimple_set_bb (patt_stmt, NULL);
+         tree lhs = gimple_get_lhs (patt_stmt);
+         if (TREE_CODE (lhs) == SSA_NAME)
+           release_ssa_name (lhs);
          if (seq)
            {
              gimple_stmt_iterator si;
              for (si = gsi_start (seq); !gsi_end_p (si); gsi_next (&si))
-               free_stmt_vec_info (gsi_stmt (si));
+               {
+                 gimple seq_stmt = gsi_stmt (si);
+                 gimple_set_bb (seq_stmt, NULL);
+                 lhs = gimple_get_lhs (patt_stmt);
+                 if (TREE_CODE (lhs) == SSA_NAME)
+                   release_ssa_name (lhs);
+                 free_stmt_vec_info (seq_stmt);
+               }
            }
-         free_stmt_vec_info (STMT_VINFO_RELATED_STMT (stmt_info));
+         free_stmt_vec_info (patt_stmt);
        }
     }