]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR tree-optimization/50672 (ice: verify_ssa failed: no immediate_use list)
authorRichard Guenther <rguenther@suse.de>
Thu, 2 Aug 2012 09:43:14 +0000 (09:43 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Thu, 2 Aug 2012 09:43:14 +0000 (09:43 +0000)
2012-08-02  Richard Guenther  <rguenther@suse.de>

PR tree-optimization/50672
Revert
2012-08-01  Richard Guenther  <rguenther@suse.de>

* tree-ssa-tail-merge.c (release_last_vdef): Remove.
(replace_block_by): Adjust.

* g++.dg/torture/pr50672.C: New testcase.

From-SVN: r190070

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/torture/pr50672.C [new file with mode: 0644]
gcc/tree-ssa-tail-merge.c

index c48a2e27ddc0b1ee6aacbb2211694b18fdf7acdb..1f6539ed59718e26154cb0dab85667ed08ae3b87 100644 (file)
@@ -1,3 +1,12 @@
+2012-08-02  Richard Guenther  <rguenther@suse.de>
+
+       PR tree-optimization/50672
+       Revert
+       2012-08-01  Richard Guenther  <rguenther@suse.de>
+
+       * tree-ssa-tail-merge.c (release_last_vdef): Remove.
+       (replace_block_by): Adjust.
+
 2012-08-02  Richard Guenther  <rguenther@suse.de>
 
        * tree-dfa.c (referenced_var_lookup): Remove.
index 604782ca8ac3b2f617c7abe46cef8e673d476bd5..3941926ab499e56b8311e57607fd93791ce0e95e 100644 (file)
@@ -1,3 +1,8 @@
+2012-08-02  Richard Guenther  <rguenther@suse.de>
+
+       PR tree-optimization/50672
+       * g++.dg/torture/pr50672.C: New testcase.
+
 2012-08-02  Janus Weil  <janus@gcc.gnu.org>
 
        PR fortran/54147
diff --git a/gcc/testsuite/g++.dg/torture/pr50672.C b/gcc/testsuite/g++.dg/torture/pr50672.C
new file mode 100644 (file)
index 0000000..614a35b
--- /dev/null
@@ -0,0 +1,22 @@
+// { dg-do compile }
+
+struct A
+{
+  bool isHint();
+};
+class B
+{
+  void makeLine( int *) const;
+  void drawLine() const; A* to() const;
+  void _print() const;
+};
+A a;
+void  B::makeLine(int *p1) const
+{
+  if (a.isHint() && to()->isHint()) ;
+  else {
+      if (p1) B::drawLine(); else B::_print();
+      return;
+  }
+  if (p1) B::drawLine(); else B::_print();
+}
index ab37336d0c47acbe4d7dbbfccefb576566ae7218..a2d4633e99344a6bc9298bcb371ec64be6261429 100644 (file)
@@ -812,6 +812,37 @@ same_succ_flush_bbs (bitmap bbs)
     same_succ_flush_bb (BASIC_BLOCK (i));
 }
 
+/* Release the last vdef in BB, either normal or phi result.  */
+
+static void
+release_last_vdef (basic_block bb)
+{
+  gimple_stmt_iterator i;
+
+  for (i = gsi_last_bb (bb); !gsi_end_p (i); gsi_prev_nondebug (&i))
+    {
+      gimple stmt = gsi_stmt (i);
+      if (gimple_vdef (stmt) == NULL_TREE)
+       continue;
+
+      mark_virtual_operand_for_renaming (gimple_vdef (stmt));
+      return;
+    }
+
+  for (i = gsi_start_phis (bb); !gsi_end_p (i); gsi_next (&i))
+    {
+      gimple phi = gsi_stmt (i);
+      tree res = gimple_phi_result (phi);
+
+      if (is_gimple_reg (res))
+       continue;
+
+      mark_virtual_phi_result_for_renaming (phi);
+      return;
+    }
+  
+}
+
 /* For deleted_bb_preds, find bbs with same successors.  */
 
 static void
@@ -1446,6 +1477,7 @@ replace_block_by (basic_block bb1, basic_block bb2)
   bb1->frequency = 0;
 
   /* Do updates that use bb1, before deleting bb1.  */
+  release_last_vdef (bb1);
   same_succ_flush_bb (bb1);
 
   delete_basic_block (bb1);