From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6155 invoked by alias); 2 Aug 2012 09:41:55 -0000 Received: (qmail 6145 invoked by uid 22791); 2 Aug 2012 09:41:54 -0000 X-SWARE-Spam-Status: No, hits=-6.1 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_DNSWL_HI,TW_TM,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from cantor2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 02 Aug 2012 09:41:41 +0000 Received: from relay2.suse.de (unknown [195.135.220.254]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id EB273A398F; Thu, 2 Aug 2012 11:41:39 +0200 (CEST) Date: Thu, 02 Aug 2012 09:41:00 -0000 From: Richard Guenther To: Tom de Vries Cc: gcc-patches@gcc.gnu.org Subject: Re: [PATCH][7/n] into-SSA TLC In-Reply-To: <5019B892.6090809@mentor.com> Message-ID: References: <5019B892.6090809@mentor.com> User-Agent: Alpine 2.00 (LNX 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2012-08/txt/msg00082.txt.bz2 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 PR tree-optimization/50672 Revert 2012-08-01 Richard Guenther * 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(); + }