From patchwork Mon Aug 30 14:57:53 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernd Schmidt X-Patchwork-Id: 63048 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 C0757B70EE for ; Tue, 31 Aug 2010 00:58:15 +1000 (EST) Received: (qmail 16716 invoked by alias); 30 Aug 2010 14:58:14 -0000 Received: (qmail 16708 invoked by uid 22791); 30 Aug 2010 14:58:14 -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; Mon, 30 Aug 2010 14:58:09 +0000 Received: (qmail 11271 invoked from network); 30 Aug 2010 14:58:07 -0000 Received: from unknown (HELO ?84.152.177.148?) (bernds@127.0.0.2) by mail.codesourcery.com with ESMTPA; 30 Aug 2010 14:58:07 -0000 Message-ID: <4C7BC6F1.2030803@codesourcery.com> Date: Mon, 30 Aug 2010 16:57:53 +0200 From: Bernd Schmidt User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.7) Gecko/20100724 Thunderbird/3.1.1 MIME-Version: 1.0 To: GCC Patches Subject: Scheduler patch: Don't ignore dependencies of asm insns 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 This is the second of the two scheduler patches I need to make a new port work, which requires accurate schedules for correctness. When we have an asm statement that depends on a load, we must not schedule the asm before the load completes. Currently, dep_cost_1 has a test for recog_memoized < 0, which is intended to ignore USE and CLOBBER insns, but also catches asm statements and makes us ignore the cost of their dependencies. Fixed with this patch. Bootstrapped and regression tested on i686-linux. Ok? Bernd * haifa-sched.c (dep_cost_1): Don't ignore dependencies of asm insns. Index: haifa-sched.c =================================================================== --- haifa-sched.c (revision 163516) +++ haifa-sched.c (working copy) @@ -864,7 +864,8 @@ dep_cost_1 (dep_t link, dw_t dw) This allows the computation of a function's result and parameter values to overlap the return and call. We don't care about the the dependence cost when only decreasing register pressure. */ - if (recog_memoized (used) < 0) + if (recog_memoized (used) < 0 && GET_CODE (PATTERN (used)) != ASM_INPUT + && asm_noperands (PATTERN (used)) < 0) { cost = 0; recog_memoized (insn);