From patchwork Mon Mar 26 10:49:41 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Aurelien Buhrig X-Patchwork-Id: 148694 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 796D1B6FA5 for ; Mon, 26 Mar 2012 21:49:27 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1333363768; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Message-ID:Date:From:User-Agent:MIME-Version:To:CC: Subject:References:In-Reply-To:Content-Type:Mailing-List: Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:Sender:Delivered-To; bh=ZES023qQC0zJHWVq2odA95kk7+k=; b=KTyA2qFYOR70/JQNdsFBKNarvYDfihZc1hNx4HcM5K3UMzd9VU+ejCnHex0/1i mkIZJv1or6XJ1AKB5CYVfaQ79oREjYGoG1IgmN3XkTBg/CeEVHxSdPrZmsycyyxw eKjXHkxU1rsSiZrFeWi1KjGRd0uHfjUalX7paSlgExUxw= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:Received:Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject:References:In-Reply-To:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=LGFWw2r3LjNg/GgbHWhJ6KY8TZe9f/r3Mtx/EP8k6wD1gt/aHfpZd0VOS5MrFS sDyHmZsUlTGhjLOQNZFHPnDRzyReKlgZ/2lRvOlg+8ySUtS5o3Nlv86nWlQ9qLh8 OwJmPh/n3qXpSE2iHjTUwLUwk7w83BBYbqV3XofJifPfs=; Received: (qmail 17443 invoked by alias); 26 Mar 2012 10:49:24 -0000 Received: (qmail 17432 invoked by uid 22791); 26 Mar 2012 10:49:23 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-bk0-f47.google.com (HELO mail-bk0-f47.google.com) (209.85.214.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 26 Mar 2012 10:49:07 +0000 Received: by bkcjg15 with SMTP id jg15so4350390bkc.20 for ; Mon, 26 Mar 2012 03:49:05 -0700 (PDT) Received: by 10.204.130.81 with SMTP id r17mr8484294bks.118.1332758945256; Mon, 26 Mar 2012 03:49:05 -0700 (PDT) Received: from [10.15.38.164] (LCaen-156-54-3-113.w80-11.abo.wanadoo.fr. [80.11.66.113]) by mx.google.com with ESMTPS id u5sm31573303bka.5.2012.03.26.03.49.02 (version=SSLv3 cipher=OTHER); Mon, 26 Mar 2012 03:49:03 -0700 (PDT) Message-ID: <4F7049C5.7040703@gmail.com> Date: Mon, 26 Mar 2012 12:49:41 +0200 From: Aurelien Buhrig User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:11.0) Gecko/20120312 Thunderbird/11.0 MIME-Version: 1.0 To: Eric Botcazou CC: Alan Modra , gcc-patches@gcc.gnu.org Subject: Re: [PATCH] Bug fix in store_bit_field_1 for big endian targets (issue 51893) References: <4F69979E.4070502@gmail.com> <201203212253.07335.ebotcazou@adacore.com> <20120323033930.GF5097@bubble.grove.modra.org> <201203241051.54973.ebotcazou@adacore.com> In-Reply-To: <201203241051.54973.ebotcazou@adacore.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 >> Passes bootstrap and regression test powerpc64-linux. > > Thanks a lot, Alan! > > So, Aurelien, you only need to adjust the formatting of the patch and post a > ChangeLog entry along with it. TIA. > Thanks Alan! Bootstrap and regression test for m68k-elf ok, but I have trouble cross compiling trunk for powerpc64-linux target... Changelog: * expmed.c (store_bit_field_1): Fix wordnum value for big endian targets Will this fix be backported to 4.6 branch for next release? Aurélien Index: gcc/expmed.c =================================================================== --- gcc/expmed.c (revision 185732) +++ gcc/expmed.c (working copy) @@ -550,7 +550,10 @@ { /* If I is 0, use the low-order word in both field and target; if I is 1, use the next to lowest word; and so on. */ - unsigned int wordnum = (backwards ? nwords - i - 1 : i); + unsigned int wordnum = (backwards + ? GET_MODE_SIZE (fieldmode) / UNITS_PER_WORD + - i - 1 + : i); unsigned int bit_offset = (backwards ? MAX ((int) bitsize - ((int) i + 1) * BITS_PER_WORD,