From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21652 invoked by alias); 3 Dec 2007 02:44:19 -0000 Received: (qmail 21602 invoked by uid 48); 3 Dec 2007 02:44:07 -0000 Date: Mon, 03 Dec 2007 02:44:00 -0000 Message-ID: <20071203024407.21601.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug tree-optimization/31081] [4.3 Regression] Inliner messes up SSA for abnormals In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "pinskia at gcc dot gnu dot org" 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-12/txt/msg00137.txt.bz2 ------- Comment #9 from pinskia at gcc dot gnu dot org 2007-12-03 02:44 ------- >>From PR 30604: 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 :-) -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31081