From patchwork Thu Sep 23 15:50:14 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernd Schmidt X-Patchwork-Id: 65542 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id A424FB70E0 for ; Fri, 24 Sep 2010 01:49:37 +1000 (EST) Received: (qmail 8910 invoked by alias); 23 Sep 2010 15:49:33 -0000 Received: (qmail 8899 invoked by uid 22791); 23 Sep 2010 15:49:32 -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; Thu, 23 Sep 2010 15:49:27 +0000 Received: (qmail 12773 invoked from network); 23 Sep 2010 15:49:25 -0000 Received: from unknown (HELO ?84.152.176.36?) (bernds@127.0.0.2) by mail.codesourcery.com with ESMTPA; 23 Sep 2010 15:49:25 -0000 Message-ID: <4C9B7736.1010504@codesourcery.com> Date: Thu, 23 Sep 2010 17:50:14 +0200 From: Bernd Schmidt User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.9) Gecko/20100911 Lightning/1.0b3pre Thunderbird/3.1.3 MIME-Version: 1.0 To: Richard Guenther CC: Jeff Law , Eric Botcazou , gcc-patches@gcc.gnu.org, Steven Bosscher , Jim Wilson Subject: Re: ifcvt/crossjump patch: Fix PR 42496, 21803 References: <4BB3CCCA.7000600@codesourcery.com> <201004101235.54302.ebotcazou@adacore.com> <4BC62EB2.40609@codesourcery.com> <201004200005.53901.ebotcazou@adacore.com> <4C460A1F.4000509@codesourcery.com> <4C56EABB.4030401@redhat.com> <4C56EB55.7010408@codesourcery.com> <4C56ECB1.9060302@redhat.com> <4C56EF21.1060801@codesourcery.com> <4C58232D.8090805@codesourcery.com> <4C58329F.6010902@redhat.com> <4C583639.9070704@codesourcery.com> <4C584E0E.2040408@redhat.com> <4C596CA5.2060207@codesourcery.com> <4C7BCCFA.90409@codesourcery.com> <4C97316B.6090902@codesourcery.com> <4C97843D.7070104@redhat.com> <4C9B26F7.3080000@codesourcery.com> In-Reply-To: Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org On 09/23/2010 04:41 PM, Richard Guenther wrote: >> I now get an bootstrap fail building Ada on x86_64-linux in >> >> Program received signal SIGSEGV, Segmentation fault. >> 0x0000000000c9ebf6 in df_simulate_one_insn_backwards (bb=0x7ffff3f0ad68, >> insn=0x0, live=0x50bab30) >> at /space/rguenther/src/svn/trunk/gcc/df-problems.c:3640 >> 3640 if (!NONDEBUG_INSN_P (insn)) It found two matching blocks, each of which had 5 insns, but didn't stop there since BB_END was a DEBUG_INSN. The first insns in the two following basic blocks matched, so flow_find_head_matching_sequence returned 6. The following patch should fix it; ok after bootstrap/test? Bernd * cfgcleanup.c (flow_find_head_matching_sequence): Terminate when reaching the end of a block if it occurs at a DEBUG_INSN. Index: cfgcleanup.c =================================================================== --- cfgcleanup.c (revision 164552) +++ cfgcleanup.c (working copy) @@ -1184,7 +1184,6 @@ flow_find_head_matching_sequence (basic_ while (true) { - /* Ignore notes. */ while (!NONDEBUG_INSN_P (i1) && i1 != BB_END (bb1)) i1 = NEXT_INSN (i1); @@ -1192,6 +1191,10 @@ flow_find_head_matching_sequence (basic_ while (!NONDEBUG_INSN_P (i2) && i2 != BB_END (bb2)) i2 = NEXT_INSN (i2); + if ((i1 == BB_END (bb1) && !NONDEBUG_INSN_P (i1)) + || (i2 == BB_END (bb2) && !NONDEBUG_INSN_P (i2))) + break; + if (NOTE_P (i1) || NOTE_P (i2) || JUMP_P (i1) || JUMP_P (i2)) break;