From patchwork Wed Sep 15 22:47:27 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: reza yazdani X-Patchwork-Id: 64924 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 DF7DBB6EF7 for ; Thu, 16 Sep 2010 08:47:35 +1000 (EST) Received: (qmail 2717 invoked by alias); 15 Sep 2010 22:47:34 -0000 Received: (qmail 2709 invoked by uid 22791); 15 Sep 2010 22:47:34 -0000 X-SWARE-Spam-Status: No, hits=-0.7 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, T_RP_MATCHES_RCVD, T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org Received: from web33006.mail.mud.yahoo.com (HELO web33006.mail.mud.yahoo.com) (209.191.69.121) by sourceware.org (qpsmtpd/0.43rc1) with SMTP; Wed, 15 Sep 2010 22:47:29 +0000 Received: (qmail 59747 invoked by uid 60001); 15 Sep 2010 22:47:28 -0000 Message-ID: <24776.52129.qm@web33006.mail.mud.yahoo.com> Received: from [139.95.251.21] by web33006.mail.mud.yahoo.com via HTTP; Wed, 15 Sep 2010 15:47:27 PDT Date: Wed, 15 Sep 2010 15:47:27 -0700 (PDT) From: reza yazdani Subject: Re: Bug bootstrap/45680 To: gcc-patches@gcc.gnu.org Cc: sebastian.pop@amd.com, rth@redhat.com MIME-Version: 1.0 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 The function min_insn_size is moved out of #ifdef ASM_OUTPUT_MAX_SKIP_PAD. Testing ------- Self compile ran with “–mdispatch-scheduling -fschedule-insns -fsched-pressure –O2". Dispatch scheduling flag was manually set on in the self compile to exercise the new code. No new test added for this implementation. Make check of i386 tests passes. No difference in the number of failures with and without the dispatch flag. ChangeLog --------- 2010-09-15 Reza Yazdani * i386.c (min_insn_size): moved. Is it okay to commit to trunk? Reza ------------------------------------------------- --- On Wed, 9/15/10, Richard Henderson wrote: > From: Richard Henderson > Subject: Re: Bug bootstrap/45680 > To: "reza yazdani" > Cc: gcc-patches@gcc.gnu.org, sebastian.pop@amd.com, "ChangpengFang" > Date: Wednesday, September 15, 2010, 3:07 PM > On 09/15/2010 01:46 PM, reza yazdani > wrote: > > Function min_insn_size is defined under "#ifdef > > ASM_OUTPUT_MAX_SKIP_PAD" flag. Dispatch Scheduler > called the function > > after #endif. > > > > In this fix we move dispatch scheduler code under the > same #ifdef. > > That's hardly the correct fix.  If the dispatch > scheduler needs > to use that function, then remove the ifdefs around its > definition. > > > r~ > Index: config/i386/i386.c =================================================================== --- config/i386/i386.c (revision 164317) +++ config/i386/i386.c (working copy) @@ -27559,7 +27559,6 @@ x86_function_profiler (FILE *file, int l } } -#ifdef ASM_OUTPUT_MAX_SKIP_PAD /* We don't have exact information about the insn sizes, but we may assume quite safely that we are informed about all 1 byte insns and memory address sizes. This is enough to eliminate unnecessary padding in @@ -27621,6 +27620,8 @@ min_insn_size (rtx insn) return 2; } +#ifdef ASM_OUTPUT_MAX_SKIP_PAD + /* AMD K8 core mispredicts jumps when there are more than 3 jumps in 16 byte window. */