From patchwork Fri Aug 5 17:41:45 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernd Schmidt X-Patchwork-Id: 108702 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 ABB97B6F77 for ; Sat, 6 Aug 2011 03:42:52 +1000 (EST) Received: (qmail 11796 invoked by alias); 5 Aug 2011 17:42:49 -0000 Received: (qmail 11783 invoked by uid 22791); 5 Aug 2011 17:42:48 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL, BAYES_00, 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; Fri, 05 Aug 2011 17:42:34 +0000 Received: (qmail 1357 invoked from network); 5 Aug 2011 17:42:33 -0000 Received: from unknown (HELO ?84.152.196.79?) (bernds@127.0.0.2) by mail.codesourcery.com with ESMTPA; 5 Aug 2011 17:42:33 -0000 Message-ID: <4E3C2B59.60508@codesourcery.com> Date: Fri, 05 Aug 2011 19:41:45 +0200 From: Bernd Schmidt User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.18) Gecko/20110801 Lightning/1.0b3pre Thunderbird/3.1.11 MIME-Version: 1.0 To: Richard Henderson CC: Eric Botcazou , Andreas Schwab , GCC Patches , Steve Ellcey , "Vladimir N. Makarov" Subject: Re: Correct fix for scheduler bug PR11320 References: <4E1EBEFE.3080002@codesourcery.com> <4E297FF8.9090504@codesourcery.com> <201107221900.13935.ebotcazou@adacore.com> <4E29B096.8080303@redhat.com> <4E29B21D.9040701@codesourcery.com> In-Reply-To: <4E29B21D.9040701@codesourcery.com> 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 07/22/11 19:23, Bernd Schmidt wrote: > On 07/22/11 19:17, Richard Henderson wrote: >> On 07/22/2011 10:00 AM, Eric Botcazou wrote: >>>> It's getting confused about loads/stores being control_flow_insns and >>>> getting scheduled past each other nonetheless. Mind testing the following? >>> >>> s/flag_non_call_exceptions/cfun->can_throw_non_call_exceptions/ >>> >> >> Why test either, since control_flow_insn_p has already done so? > > Just to save an unnecessary call to add_dependence. > > Although, come to think of it, it might not be unnecessary. The reason > these two insns aren't already dependent on each other seems to be that > they have opposite conditions, and I guess that might happen with > conditional calls as well. Ok, so Andreas has verified that the following fixes the problem on ia64. Ok? Bernd PR rtl-optimization/49900 * sched-ebb.c (add_deps_for_risky_insns): Also add dependencies to ensure basic blocks stay in the same order. Index: gcc/sched-ebb.c =================================================================== --- gcc/sched-ebb.c (revision 176879) +++ gcc/sched-ebb.c (working copy) @@ -397,6 +397,9 @@ add_deps_for_risky_insns (rtx head, rtx bb = BLOCK_FOR_INSN (insn); bb->aux = last_block; last_block = bb; + /* Ensure blocks stay in the same order. */ + if (last_jump) + add_dependence (insn, last_jump, REG_DEP_ANTI); last_jump = insn; } else if (INSN_P (insn) && last_jump != NULL_RTX)