From patchwork Sat Jan 19 19:57:26 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uros Bizjak X-Patchwork-Id: 213882 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 360672C0087 for ; Sun, 20 Jan 2013 06:57:40 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1359230261; h=Comment: DomainKey-Signature:Received:Received:Received:Received: MIME-Version:Received:Date:Message-ID:Subject:From:To:Cc: Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=RxhkbkK UIWbt3r2FkzlaOmhX7tg=; b=f9s+CHuMBbJBiWDGreGR45rzi6coHJtynniuuwy 8KsbVJyLUNtVghiHAbg1NnEgqKyl6LG/rZOMWZ67NDVXVO/BIyq5yfXbvfr7YlID Tx6Qaq5cZxZ3+VL18fD8R1Nb96BvuwSZQX0DZBbMKD1Fwmv8yPSRxg9gObxtDHwj bFrk= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:MIME-Version:X-Received:Received:Date:Message-ID:Subject:From:To:Cc:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=jOi+fqjT0KFPeirhmSRckqsm+R7R7Mm9th2hAvwBoXvqnSl4ITP4hAHX/WCcDc N/lrVEiUQLC13EBZSXDm59dNS1nS8moE4EDhfvFSKFl/8trc7AedJrJTBWlJ1yKk k7rY2HZbrlDa463k2MxNFFdqYFSCIEEya8iU0MWB4dkl4=; Received: (qmail 7685 invoked by alias); 19 Jan 2013 19:57:36 -0000 Received: (qmail 7671 invoked by uid 22791); 19 Jan 2013 19:57:34 -0000 X-SWARE-Spam-Status: No, hits=-4.3 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, KHOP_RCVD_TRUST, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE, TW_ZJ X-Spam-Check-By: sourceware.org Received: from mail-ob0-f170.google.com (HELO mail-ob0-f170.google.com) (209.85.214.170) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 19 Jan 2013 19:57:27 +0000 Received: by mail-ob0-f170.google.com with SMTP id wp18so4819849obc.1 for ; Sat, 19 Jan 2013 11:57:27 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.182.95.133 with SMTP id dk5mr10548956obb.14.1358625446916; Sat, 19 Jan 2013 11:57:26 -0800 (PST) Received: by 10.182.153.201 with HTTP; Sat, 19 Jan 2013 11:57:26 -0800 (PST) Date: Sat, 19 Jan 2013 20:57:26 +0100 Message-ID: Subject: [PATCH, haifa-sched]: Fix PR56023, -fcompare-debug failure due to sched1 pass on 4.6 branch From: Uros Bizjak To: gcc-patches@gcc.gnu.org Cc: =?ISO-8859-1?Q?Ra=FAl_Porcel?= 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 Hello! We should not update ticks of instructions, dependent on debug instruction. Without the patch, the scheduling order depends on the presence of debug instructions and leads to -fcompare-debug failures. 2012-01-19 Uros Bizjak PR rtl-optimization/56023 * haifa-sched.c (fix_inter_tick): Do not update ticks of instructions, dependent on debug instruction. testsuite/ChangeLog: 2012-01-19 Uros Bizjak PR rtl-optimization/56023 * gcc.dg/pr56023.c: New test. Tested on 4.6 branch on alpha-linux-gnu, where it fixes the bootstrap failure and x86_64-pc-linux-gnu {,-m32}. The patch should be applied to 4.7 and 4.8 branches as well. Patch was also tested on mainline x86_64-pc-linux-gnu {,-m32}. OK for 4.6, 4.7 and mainline? Uros. Index: haifa-sched.c =================================================================== --- haifa-sched.c (revision 195276) +++ haifa-sched.c (working copy) @@ -3684,6 +3684,9 @@ fix_inter_tick (rtx head, rtx tail) INSN_TICK (head) = tick; } + if (DEBUG_INSN_P (head)) + continue; + FOR_EACH_DEP (head, SD_LIST_RES_FORW, sd_it, dep) { rtx next; Index: testsuite/gcc.dg/pr56023.c =================================================================== --- testsuite/gcc.dg/pr56023.c (revision 0) +++ testsuite/gcc.dg/pr56023.c (working copy) @@ -0,0 +1,19 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fcompare-debug" } */ + +void +foo (char *c) +{ + unsigned int x = 0; + unsigned int i; + + for (i = 0; c[i]; i++) + { + if (i >= 5 && x != 1) + break; + else if (c[i] == ' ') + x = i; + else if (c[i] == '/' && c[i + 1] != ' ' && i) + x = i + 1; + } +}