From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14506 invoked by alias); 22 Mar 2011 13:25:46 -0000 Received: (qmail 14476 invoked by uid 22791); 22 Mar 2011 13:25:45 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (74.125.121.67) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 22 Mar 2011 13:25:39 +0000 Received: from hpaq3.eem.corp.google.com (hpaq3.eem.corp.google.com [172.25.149.3]) by smtp-out.google.com with ESMTP id p2MDPbSa023691 for ; Tue, 22 Mar 2011 06:25:37 -0700 Received: from qyk30 (qyk30.prod.google.com [10.241.83.158]) by hpaq3.eem.corp.google.com with ESMTP id p2MDPZcM016399 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Tue, 22 Mar 2011 06:25:36 -0700 Received: by qyk30 with SMTP id 30so6780302qyk.14 for ; Tue, 22 Mar 2011 06:25:35 -0700 (PDT) MIME-Version: 1.0 Received: by 10.224.6.142 with SMTP id 14mr5015115qaz.10.1300800334645; Tue, 22 Mar 2011 06:25:34 -0700 (PDT) Received: by 10.229.106.195 with HTTP; Tue, 22 Mar 2011 06:25:34 -0700 (PDT) Date: Tue, 22 Mar 2011 13:25:00 -0000 Message-ID: Subject: Hints for backporting gcc 4.5 powerpc fix to gcc 4.4.3? From: Simon Baldwin To: gcc@gcc.gnu.org Content-Type: text/plain; charset=ISO-8859-1 X-System-Of-Record: true X-IsSubscribed: yes Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org X-SW-Source: 2011-03/txt/msg00320.txt.bz2 I'm currently trying to backport a small part of gcc 4.5 r151729 to gcc 4.4.3. This revision fixes a problem in powerpc code generation that leads to gcc not using lmw/stmw instructions in function prologue and epilogues, where it could otherwise validly use them. On the face of things, the central piece of r151729 I seem to want is just this: Index: gcc/config/rs6000/rs6000.c =================================================================== --- gcc/config/rs6000/rs6000.c (revision 151728) +++ gcc/config/rs6000/rs6000.c (revision 151729) @@ -18033,7 +18033,8 @@ static bool no_global_regs_above (int first, bool gpr) { int i; - for (i = first; i < gpr ? 32 : 64 ; i++) + int last = gpr ? 32 : 64; + for (i = first; i < last; i++) if (global_regs[i]) return false; return true; Taking only that and leaving out all of the rest of r151729 lets me build a powerpc gcc that does use lmw/stmw instructions in function prologue and epilogues as hoped. Unfortunately it also has bad codegen elsewhere. So it seems I need more than just this little piece of r151729. Unfortunately, r151729 is a fairly large patch that seems to do a number of jobs and which does not apply readily to gcc 4.4. At the moment it's not clear to me what other parts of it I might need. Can anyone here offer any hints or pointers on how to extract from the r151729 diff just the few pieces needed to fix this single powerpc codegen bug in gcc 4.4.3? Anyone recognize this issue and already dealt with it in isolation? Thanks. -- Google UK Limited | Registered Office: Belgrave House, 76 Buckingham Palace Road, London SW1W 9TQ | Registered in England Number: 3977902