From patchwork Tue Nov 9 09:30:27 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Haley X-Patchwork-Id: 70521 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 5F077B711F for ; Tue, 9 Nov 2010 20:30:49 +1100 (EST) Received: (qmail 26053 invoked by alias); 9 Nov 2010 09:30:46 -0000 Received: (qmail 26045 invoked by uid 22791); 9 Nov 2010 09:30:46 -0000 X-SWARE-Spam-Status: No, hits=-6.8 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_HI, SPF_HELO_PASS, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 09 Nov 2010 09:30:41 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id oA99UUmS018523 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 9 Nov 2010 04:30:32 -0500 Received: from zebedee.pink (ovpn-113-122.phx2.redhat.com [10.3.113.122]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id oA99US5U029286; Tue, 9 Nov 2010 04:30:29 -0500 Message-ID: <4CD914B3.7010906@redhat.com> Date: Tue, 09 Nov 2010 09:30:27 +0000 From: Andrew Haley User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.5) Gecko/20091209 Fedora/3.0-4.fc12 Thunderbird/3.0 MIME-Version: 1.0 To: Joern Rennecke CC: gcc-patches@gcc.gnu.org, Per Bothner , Tom Tromey , Paul Koning Subject: Re: RFA: Fix java/46386 References: <20101109034027.gjiu9m88ow0cwcwk-nzlynne@webmail.spamcop.net> In-Reply-To: <20101109034027.gjiu9m88ow0cwcwk-nzlynne@webmail.spamcop.net> X-IsSubscribed: yes 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 11/09/2010 08:40 AM, Joern Rennecke wrote: > Tested build of 'all-gcc' for > i686-pc-linux-gnu X pdp11-elf > configureed with --enable-werror-always configuration. > > Bootstrapping on i686-pc-linux-gnu. I am always opposed to obfuscating code in order to suppress bogus warnings. Can I suggest temp <<= (POINTER_SIZE > 32) ? POINTER_SIZE - 32 : 0; ? Andrew. Index: java/constants.c =================================================================== --- java/constants.c (revision 166429) +++ java/constants.c (working copy) @@ -534,14 +534,16 @@ build_constants_constructor (void) case CONSTANT_InterfaceMethodref: { unsigned HOST_WIDE_INT temp = outgoing_cpool->data[i].w; + int big_endian_correction; /* Make sure that on a big-endian machine with 64-bit pointers this 32-bit jint appears in the first word. FIXME: This is a kludge. The field we're initializing is not a scalar but a union, and that's how we should represent it in the compiler. We should fix this. */ - if (BYTES_BIG_ENDIAN && POINTER_SIZE > 32) - temp <<= POINTER_SIZE - 32; + big_endian_correction = POINTER_SIZE - 32; + if (BYTES_BIG_ENDIAN && big_endian_correction > 0) + temp <<= big_endian_correction; CONSTRUCTOR_PREPEND_VALUE (t, get_tag_node (outgoing_cpool->tags[i])); CONSTRUCTOR_PREPEND_VALUE (d,