From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4227 invoked by alias); 9 Nov 2007 15:37:30 -0000 Received: (qmail 4154 invoked by uid 48); 9 Nov 2007 15:37:15 -0000 Date: Fri, 09 Nov 2007 15:37:00 -0000 Message-ID: <20071109153715.4153.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug tree-optimization/30604] Unable to coalesce ssa_names and which are marked as MUST COALESCE In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "amacleod at redhat dot com" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2007-11/txt/msg00801.txt.bz2 ------- Comment #11 from amacleod at redhat dot com 2007-11-09 15:37 ------- OK, new investigation show that using the smaller testcase firebird2-nav.cc shows the inliner is misbehaving. before inlining (*041t.profile): # BLOCK 2 freq:10000 # PRED: ENTRY [100.0%] (fallthru,exec) D.2709_4 = request_3(D)->req_pool; D.2710_5 = (struct blk *) D.2709_4; D.2711_6 = request_3(D)->req_transaction; D.2712_10 = VIO_get (tdbb_7(D), rpb_8(D), rsb_9(D), D.2711_6, D.2710_5); # SUCC: 4 (ab,eh,exec) 3 [100.0%] (fallthru,exec) # BLOCK 3 freq:10000 # PRED: 2 [100.0%] (fallthru,exec) result_12(ab) = (BOOLEAN) D.2712_10; <...> BTR_key (tdbb_7(D), D.2719_20, D.2718_19, D.2717_18, &value, 0B); goto ; # SUCC: 4 (ab,eh,exec) 5 [100.0%] (fallthru,exec) # BLOCK 4 # PRED: 2 (ab,eh,exec) 3 (ab,eh,exec) # result_1(ab) = PHI :; <...> # BLOCK 5 freq:10000 # PRED: 3 [100.0%] (fallthru,exec) 4 [100.0%] (fallthru,exec) # result_2 = PHI return result_2; # SUCC: EXIT [100.0%] and after inlining (*046i.inline) we see: : : D.2882_11 = request_9(D)->req_pool; D.2883_12 = (struct blk *) D.2882_11; D.2884_13 = request_9(D)->req_transaction; D.2885_14 = VIO_get (tdbb_8(D), rpb_3(D), rsb_1(D), D.2884_13, D.2883_12); : result_15(ab) = (BOOLEAN) D.2885_14; <...> BTR_key (tdbb_8(D), D.2892_22, D.2891_21, D.2890_20, &value, 0B); goto ; # result_24(ab) = PHI :; <...> : # result_23 = PHI if (result_23 != 0) goto ; else goto ; : return 1; Basic block 7 is missing a PHI node which should merge result_23 and result_10. The result of this missing PHI should then be used in block 5 instead of result_10. The way it currently sits, result 10 is live through basic block 3, which makes it conflict with result_15, and makes the abnormal edges uncoalescable. Someone familiar with the inliner can probably fix this quickly. I took a quick look but its a different world in there :-) -- amacleod at redhat dot com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jh at suse dot cz http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30604