From patchwork Tue Oct 5 12:35:41 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Belevantsev X-Patchwork-Id: 66824 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 42C69B70D0 for ; Tue, 5 Oct 2010 23:36:19 +1100 (EST) Received: (qmail 21509 invoked by alias); 5 Oct 2010 12:36:06 -0000 Received: (qmail 19885 invoked by uid 22791); 5 Oct 2010 12:35:51 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL, BAYES_00, TW_CF, TW_QN, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp.ispras.ru (HELO smtp.ispras.ru) (83.149.198.201) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 05 Oct 2010 12:35:45 +0000 Received: from [10.10.3.52] (winnie.ispras.ru [83.149.198.236]) by smtp.ispras.ru (Postfix) with ESMTP id D6E975D40A6; Tue, 5 Oct 2010 16:34:37 +0400 (MSD) Message-ID: <4CAB1B9D.3060803@ispras.ru> Date: Tue, 05 Oct 2010 16:35:41 +0400 From: Andrey Belevantsev User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:2.0b7pre) Gecko/20101003 Thunderbird/3.3a1pre MIME-Version: 1.0 To: GCC Patches CC: "Vladimir N. Makarov" Subject: [PATCH] Fix PR45570 X-IsSubscribed: yes 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, As explained in the PR trail, this is the variant of PR40101 when we cannot devise a positive seqno for a bookkeeping copy by examining insn's neighbors. Fixed by removing the assert and allowing the code of PR40101 patch to provide an arbitrary positive value. Bootstrapped and regtested on ia64-linux, the testcase is also verified on x86-64 as reported in the PR. Ok for trunk? Andrey 2010-10-05 Andrey Belevantsev PR rtl-optimization/45570 * sel-sched-ir.c (cfg_preds_1): When walking out of the region, assert that we are pipelining outer loops. Allow returning zero predecessors. * gcc.dg/pr45570.c: New test. Index: gcc/testsuite/gcc.dg/pr45570.c =================================================================== *** gcc/testsuite/gcc.dg/pr45570.c (revision 0) --- gcc/testsuite/gcc.dg/pr45570.c (revision 0) *************** *** 0 **** --- 1,29 ---- + /* { dg-do compile { target powerpc*-*-* ia64-*-* x86_64-*-* } } */ + /* { dg-options "O3 -fselective-scheduling2 -fsel-sched-pipelining -fsel-sched-pipelining-outer-loops -ftracer" } */ + void + parser_get_next_char (char c, int qm, char *p) + { + int quote_mode = 0; + for (; *p; p++) + { + if (qm) + { + if (quote_mode == 0 && *p == '"' && *(p - 1)) + { + quote_mode = 1; + continue; + } + if (quote_mode && *p == '"' && *(p - 1)) + quote_mode = 0; + } + if (quote_mode == 0 && *p == c && *(p - 1)) + break; + } + } + + void + parser_get_next_parameter (char *p) + { + parser_get_next_char (':', 1, p); + } + Index: gcc/sel-sched-ir.c =================================================================== *** gcc/sel-sched-ir.c (revision 164986) --- gcc/sel-sched-ir.c (working copy) *************** cfg_preds_1 (basic_block bb, insn_t **pr *** 4580,4587 **** basic_block pred_bb = e->src; insn_t bb_end = BB_END (pred_bb); ! /* ??? This code is not supposed to walk out of a region. */ ! gcc_assert (in_current_region_p (pred_bb)); if (sel_bb_empty_p (pred_bb)) cfg_preds_1 (pred_bb, preds, n, size); --- 4580,4591 ---- basic_block pred_bb = e->src; insn_t bb_end = BB_END (pred_bb); ! if (!in_current_region_p (pred_bb)) ! { ! gcc_assert (flag_sel_sched_pipelining_outer_loops ! && current_loop_nest); ! continue; ! } if (sel_bb_empty_p (pred_bb)) cfg_preds_1 (pred_bb, preds, n, size); *************** cfg_preds_1 (basic_block bb, insn_t **pr *** 4594,4600 **** } } ! gcc_assert (*n != 0); } /* Find all predecessors of BB and record them in PREDS and their number --- 4598,4606 ---- } } ! gcc_assert (*n != 0 ! || (flag_sel_sched_pipelining_outer_loops ! && current_loop_nest)); } /* Find all predecessors of BB and record them in PREDS and their number