From patchwork Tue Nov 9 10:25:30 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joern Rennecke X-Patchwork-Id: 70523 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 EDF82B70AF for ; Tue, 9 Nov 2010 21:25:47 +1100 (EST) Received: (qmail 7249 invoked by alias); 9 Nov 2010 10:25:40 -0000 Received: (qmail 7231 invoked by uid 22791); 9 Nov 2010 10:25:38 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL, BAYES_00, MIME_QP_LONG_LINE, RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from c60.cesmail.net (HELO c60.cesmail.net) (216.154.195.49) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 09 Nov 2010 10:25:32 +0000 Received: from unknown (HELO epsilon2) ([192.168.1.60]) by c60.cesmail.net with ESMTP; 09 Nov 2010 05:25:30 -0500 Received: from 89.241.159.65 ([89.241.159.65]) by webmail.spamcop.net (Horde MIME library) with HTTP; Tue, 09 Nov 2010 05:25:30 -0500 Message-ID: <20101109052530.4n6wwwhu4o40wkw8-nzlynne@webmail.spamcop.net> Date: Tue, 09 Nov 2010 05:25:30 -0500 From: Joern Rennecke To: Andrew Haley 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> <4CD914B3.7010906@redhat.com> In-Reply-To: <4CD914B3.7010906@redhat.com> MIME-Version: 1.0 User-Agent: Internet Messaging Program (IMP) H3 (4.1.4) 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 Quoting Andrew Haley : > I am always opposed to obfuscating code in order to suppress bogus warnings. > > Can I suggest > > temp <<= (POINTER_SIZE > 32) ? POINTER_SIZE - 32 : 0; Yes, that also works fine for the pdp11 build. Currently bootstrapping on i686-pc-linux-gnu. 2010-11-09 Joern Rennecke Andrew Haley PR java/46386 gcc/java: * constants.c (build_constants_constructor): Avoid negative shift. gcc: * config/pdp11/t-pdp11 (java/constants.o-warn): Remove. Index: java/constants.c =================================================================== --- java/constants.c (revision 166429) +++ java/constants.c (working copy) @@ -540,8 +540,8 @@ build_constants_constructor (void) 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; + if (BYTES_BIG_ENDIAN) + temp <<= ((POINTER_SIZE > 32) ? POINTER_SIZE - 32 : 0); CONSTRUCTOR_PREPEND_VALUE (t, get_tag_node (outgoing_cpool->tags[i])); CONSTRUCTOR_PREPEND_VALUE (d, Index: config/pdp11/t-pdp11 =================================================================== --- config/pdp11/t-pdp11 (revision 166429) +++ config/pdp11/t-pdp11 (working copy) @@ -42,7 +42,3 @@ MULTILIB_OPTIONS = msoft-float # We could say "-Werror -Wno-error=type-limits", alas, not all supported # gcc bootstrap compilers support the latter option. dwarf2out.o-warn = -Wno-error - -# Likewise, java/constants.c:build_constants_constructor has a negative shift -# count (in never-executed code) due to the small POINTER_SIZE. -java/constants.o-warn = -Wno-error