From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26509 invoked by alias); 27 May 2004 19:01:49 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 26502 invoked by alias); 27 May 2004 19:01:48 -0000 Date: Fri, 28 May 2004 10:25:00 -0000 Message-ID: <20040527190148.26500.qmail@sourceware.org> From: "rakdver at atrey dot karlin dot mff dot cuni dot cz" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20040525193217.15654.green@redhat.com> References: <20040525193217.15654.green@redhat.com> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug tree-optimization/15654] [3.5 Regression] ICE in calculate_live_on_entry with -O2 -fno-tree-dominator-opts X-Bugzilla-Reason: CC X-SW-Source: 2004-05/txt/msg03294.txt.bz2 List-Id: ------- Additional Comments From rakdver at atrey dot karlin dot mff dot cuni dot cz 2004-05-27 19:01 ------- Subject: Re: [3.5 Regression] ICE in calculate_live_on_entry with -O2 -fno-tree-dominator-opts Hello, > (In reply to comment #6) > > The problem actually is in tailcall optimization, where we remove the call > > that defines iCodeTop_8, but not the assigment iCodeTop_9 = iCodeTop_8 > > that follows it. I am testing the patch for the problem. > > Thanks to everyone who's helped with this bug! > > How's the testing going Zdenek? the machine I tested it on crashed, so I am rerunning the tests. Here is the patch, if someone wants to try it. Zdenek Index: tree-tailcall.c =================================================================== RCS file: /cvs/gcc/gcc/gcc/tree-tailcall.c,v retrieving revision 2.3 diff -c -3 -p -r2.3 tree-tailcall.c *** tree-tailcall.c 15 May 2004 09:39:29 -0000 2.3 --- tree-tailcall.c 26 May 2004 23:55:40 -0000 *************** eliminate_tail_call (struct tailcall *t) *** 646,651 **** --- 646,652 ---- stmt_ann_t ann; vdef_optype vdefs; unsigned i; + block_stmt_iterator bsi; stmt = bsi_stmt (t->call_bsi); get_stmt_operands (stmt); *************** eliminate_tail_call (struct tailcall *t) *** 665,670 **** --- 666,686 ---- first = ENTRY_BLOCK_PTR->succ->dest; + /* Remove the code after call_bsi that will become unreachable. The + possibly unreachable code in other blocks is removed later in + cfg cleanup. */ + bsi = t->call_bsi; + bsi_next (&bsi); + while (!bsi_end_p (bsi)) + { + /* Do not remove the return statement, so that redirect_edge_and_branch + sees how the block ends. */ + if (TREE_CODE (bsi_stmt (bsi)) == RETURN_EXPR) + break; + + bsi_remove (&bsi); + } + /* Replace the call by a jump to the start of function. */ e = redirect_edge_and_branch (t->call_block->succ, first); if (!e) *************** eliminate_tail_call (struct tailcall *t) *** 682,688 **** param = TREE_CHAIN (param), args = TREE_CHAIN (args)) { - for (phi = phi_nodes (first); phi; phi = TREE_CHAIN (phi)) if (param == SSA_NAME_VAR (PHI_RESULT (phi))) break; --- 698,703 ---- -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15654