From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28458 invoked by alias); 23 Mar 2011 14:51:13 -0000 Received: (qmail 28263 invoked by uid 22791); 23 Mar 2011 14:51:08 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 23 Mar 2011 14:51:00 +0000 Received: (qmail 3350 invoked from network); 23 Mar 2011 14:50:58 -0000 Received: from unknown (HELO ?84.152.161.180?) (bernds@127.0.0.2) by mail.codesourcery.com with ESMTPA; 23 Mar 2011 14:50:58 -0000 Message-ID: <4D8A089D.7020507@codesourcery.com> Date: Wed, 23 Mar 2011 14:51:00 -0000 From: Bernd Schmidt User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.15) Gecko/20110309 Lightning/1.0b3pre Thunderbird/3.1.9 MIME-Version: 1.0 To: GCC Patches Subject: [PATCH 3/6] Allow jumps in epilogues References: <4D8A0703.9090306@codesourcery.com> In-Reply-To: <4D8A0703.9090306@codesourcery.com> Content-Type: multipart/mixed; boundary="------------060507000402070309020104" 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: 2011-03/txt/msg01496.txt.bz2 This is a multi-part message in MIME format. --------------060507000402070309020104 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-length: 348 dwarf2out has code that starts scanning from NOTE_INSN_EPILOGUE_BEG until it finds the return jump. When there is common code in several blocks ending in a return, we might want to share this, and in that case it would be possible to encounter a simplejump rather than a returnjump. This should be safe, and the following patch allows it. Bernd --------------060507000402070309020104 Content-Type: text/plain; name="sj-ep.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="sj-ep.diff" Content-length: 2806 * cfgcleanup.c (flow_find_head_matching_sequence): Ignore epilogue notes. * df-problems.c (can_move_insns_across): Don't stop at epilogue notes. * dwarf2out.c (dwarf2out_cfi_begin_epilogue): Also allow a simplejump to end the block. Index: gcc/cfgcleanup.c =================================================================== --- gcc.orig/cfgcleanup.c +++ gcc/cfgcleanup.c @@ -1184,20 +1184,12 @@ flow_find_head_matching_sequence (basic_ while (true) { - /* Ignore notes, except NOTE_INSN_EPILOGUE_BEG. */ + /* Ignore notes. */ while (!NONDEBUG_INSN_P (i1) && i1 != BB_END (bb1)) - { - if (NOTE_P (i1) && NOTE_KIND (i1) == NOTE_INSN_EPILOGUE_BEG) - break; - i1 = NEXT_INSN (i1); - } + i1 = NEXT_INSN (i1); while (!NONDEBUG_INSN_P (i2) && i2 != BB_END (bb2)) - { - if (NOTE_P (i2) && NOTE_KIND (i2) == NOTE_INSN_EPILOGUE_BEG) - break; - i2 = NEXT_INSN (i2); - } + i2 = NEXT_INSN (i2); if ((i1 == BB_END (bb1) && !NONDEBUG_INSN_P (i1)) || (i2 == BB_END (bb2) && !NONDEBUG_INSN_P (i2))) Index: gcc/df-problems.c =================================================================== --- gcc.orig/df-problems.c +++ gcc/df-problems.c @@ -3953,8 +3953,6 @@ can_move_insns_across (rtx from, rtx to, { if (CALL_P (insn)) break; - if (NOTE_P (insn) && NOTE_KIND (insn) == NOTE_INSN_EPILOGUE_BEG) - break; if (NONDEBUG_INSN_P (insn)) { if (may_trap_or_fault_p (PATTERN (insn)) Index: gcc/dwarf2out.c =================================================================== --- gcc.orig/dwarf2out.c +++ gcc/dwarf2out.c @@ -2939,10 +2939,10 @@ dwarf2out_frame_debug (rtx insn, bool af dwarf2out_flush_queued_reg_saves (); } -/* Determine if we need to save and restore CFI information around this - epilogue. If SIBCALL is true, then this is a sibcall epilogue. If - we do need to save/restore, then emit the save now, and insert a - NOTE_INSN_CFA_RESTORE_STATE at the appropriate place in the stream. */ +/* Determine if we need to save and restore CFI information around + this epilogue. If we do need to save/restore, then emit the save + now, and insert a NOTE_INSN_CFA_RESTORE_STATE at the appropriate + place in the stream. */ void dwarf2out_cfi_begin_epilogue (rtx insn) @@ -2957,8 +2957,10 @@ dwarf2out_cfi_begin_epilogue (rtx insn) if (!INSN_P (i)) continue; - /* Look for both regular and sibcalls to end the block. */ - if (returnjump_p (i)) + /* Look for both regular and sibcalls to end the block. Various + optimization passes may cause us to jump to a common epilogue + tail, so we also accept simplejumps. */ + if (returnjump_p (i) || simplejump_p (i)) break; if (CALL_P (i) && SIBLING_CALL_P (i)) break; --------------060507000402070309020104--