From patchwork Fri May 24 20:34:31 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Bosscher X-Patchwork-Id: 246285 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]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "localhost", Issuer "www.qmailtoaster.com" (not verified)) by ozlabs.org (Postfix) with ESMTPS id D6A1C2C0098 for ; Sat, 25 May 2013 06:35:24 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:from:date:message-id:subject:to:content-type; q= dns; s=default; b=C2b2Opdvd4Wh6mIezKR8r0vYZSMUFZdB1A0nwmzYRWH7U9 3aKnrSL40fsfT3UBjt/aEnhdukmJ/vlgOJaU0fp6Kb7GGhy8CEesIq+xbmkoet5p jdFEvSX+4WuzDmSx3aX2HpINdn/lNy9IJ4bmLMregIrgFpfDO3VD04LkQmip0= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:from:date:message-id:subject:to:content-type; s= default; bh=TvKfQaWWPwy/S2G0SQw8moCsK4c=; b=WTfbCb9rVoifk1INSu0V X0rV0fIYk7e08l5brdTUWpFbUOh0BO0N4pJmQFa/5KvB/3lny0Y1yhGKFEEYKSTo nIHQQOI1ZhnjGbCgiQ5RxvTtnd2gd8MKL2Dl7ctoGDvHVkJSUDnCunXXoLeNshBA MgHIfSc3p7LRZ4EIHLK5RF8= Received: (qmail 32197 invoked by alias); 24 May 2013 20:35:18 -0000 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 Received: (qmail 32188 invoked by uid 89); 24 May 2013 20:35:18 -0000 X-Spam-SWARE-Status: No, score=-2.7 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE, SPF_PASS, TW_CF autolearn=ham version=3.3.1 Received: from mail-ve0-f177.google.com (HELO mail-ve0-f177.google.com) (209.85.128.177) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Fri, 24 May 2013 20:35:13 +0000 Received: by mail-ve0-f177.google.com with SMTP id ox1so3779035veb.36 for ; Fri, 24 May 2013 13:35:11 -0700 (PDT) X-Received: by 10.220.73.135 with SMTP id q7mr9706850vcj.33.1369427711636; Fri, 24 May 2013 13:35:11 -0700 (PDT) MIME-Version: 1.0 Received: by 10.58.50.40 with HTTP; Fri, 24 May 2013 13:34:31 -0700 (PDT) From: Steven Bosscher Date: Fri, 24 May 2013 22:34:31 +0200 Message-ID: Subject: [patch] PR debug/56950 To: GCC Patches , Jakub Jelinek Hello, haifa-sched.c:sched_extend_bb inserts a note at the function end to keep sched_info->next_tail non-NULL. But it fails to look around DEBUG_INSNs, resulting in a compare-debug failure. Fixed with this patch. I'm not entirely happy with this patch because in sched1 we insert a note between basic blocks while in cfglayout mode, but it's good enough for now and it fixes this regression. Bootstrapped&tested on x86_64-unknown-linux-gnu. OK for trunk? Ciao! Steven PR debug/56950 * haifa-sched.c (sched_extend_bb): Ignore DEBUG_INSNs. Index: haifa-sched.c =================================================================== --- haifa-sched.c (revision 199028) +++ haifa-sched.c (working copy) @@ -7435,20 +7435,19 @@ find_fallthru_edge_from (basic_block pre static void sched_extend_bb (void) { - rtx insn; - /* The following is done to keep current_sched_info->next_tail non null. */ - insn = BB_END (EXIT_BLOCK_PTR->prev_bb); - if (NEXT_INSN (insn) == 0 + rtx end = BB_END (EXIT_BLOCK_PTR->prev_bb); + rtx insn = DEBUG_INSN_P (end) ? prev_nondebug_insn (end) : end; + if (NEXT_INSN (end) == 0 || (!NOTE_P (insn) && !LABEL_P (insn) /* Don't emit a NOTE if it would end up before a BARRIER. */ - && !BARRIER_P (NEXT_INSN (insn)))) + && !BARRIER_P (NEXT_INSN (end)))) { - rtx note = emit_note_after (NOTE_INSN_DELETED, insn); - /* Make insn appear outside BB. */ + rtx note = emit_note_after (NOTE_INSN_DELETED, end); + /* Make note appear outside BB. */ set_block_for_insn (note, NULL); - BB_END (EXIT_BLOCK_PTR->prev_bb) = insn; + BB_END (EXIT_BLOCK_PTR->prev_bb) = end; } }