This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH][7/n] into-SSA TLC
On Thu, 2 Aug 2012, Tom de Vries wrote:
> On 01/08/12 10:47, Richard Guenther wrote:
> > * tree-ssa-tail-merge.c (release_last_vdef): Remove.
> > (replace_block_by): Adjust.
> > (tail_merge_optimize): Use mark_virtual_operands_for_renaming.
>
> Richard,
>
> this caused PR50672 to trigger again.
Hmm, indeed. Reverted as follows.
Richard.
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.
Index: gcc/tree-ssa-tail-merge.c
===================================================================
*** gcc/tree-ssa-tail-merge.c (revision 190067)
--- gcc/tree-ssa-tail-merge.c (working copy)
*************** same_succ_flush_bbs (bitmap bbs)
*** 812,817 ****
--- 812,848 ----
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
*************** replace_block_by (basic_block bb1, basic
*** 1446,1451 ****
--- 1477,1483 ----
bb1->frequency = 0;
/* Do updates that use bb1, before deleting bb1. */
+ release_last_vdef (bb1);
same_succ_flush_bb (bb1);
delete_basic_block (bb1);
Index: gcc/testsuite/g++.dg/torture/pr50672.C
===================================================================
*** gcc/testsuite/g++.dg/torture/pr50672.C (revision 0)
--- gcc/testsuite/g++.dg/torture/pr50672.C (working copy)
***************
*** 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();
+ }