From patchwork Wed Apr 11 15:57:07 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rainer Orth X-Patchwork-Id: 151817 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 D0298B705A for ; Thu, 12 Apr 2012 01:57:41 +1000 (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=1334764662; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Received:From:To:Cc:Subject:References:Date:In-Reply-To: Message-ID:User-Agent:MIME-Version:Content-Type:Mailing-List: Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:Sender:Delivered-To; bh=hCT0EOjOuo/RBmMRXGQtwcrvP14=; b=Klc3rQMH6sDnyo94M7kfaFnumuLfGRCOtcVimTHae0C52TA8Q3hlzQ4atSc62Y Mf4U4kyRrPDLvGvu4cl9QuMgs47Nss+UIKXmKT5D2Nchqoo26d/ufotJzCHhwai3 nhcqqEAy8qV+468yNjYMS60Ve1sNqeKrk5lRFnMkZldiI= 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:Received:From:To:Cc:Subject:References:Date:In-Reply-To:Message-ID:User-Agent:MIME-Version:Content-Type:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=U9Xj5UZ8M72B7iPLalcqeKcAZXtjHJJuSwQ1zshwsMW+Dbf0OrG0fSseIiHlHd 1ftYgkvtooe1k+sPO5TOyOcgnmIMsqrnqzAfD+vkdCUzXn1bRe3TTP4vVGTykCd7 5MNkyCWDbG0pqom3SVFPP9dL24tBrhCrPrU5OIwV6b27g=; Received: (qmail 15936 invoked by alias); 11 Apr 2012 15:57:33 -0000 Received: (qmail 15913 invoked by uid 22791); 11 Apr 2012 15:57:28 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL, BAYES_00, TW_JC, T_RP_MATCHES_RCVD, T_TVD_MIME_NO_HEADERS X-Spam-Check-By: sourceware.org Received: from snape.CeBiTec.Uni-Bielefeld.DE (HELO smtp-relay.CeBiTec.Uni-Bielefeld.DE) (129.70.160.84) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 11 Apr 2012 15:57:12 +0000 Received: from localhost (localhost.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) by smtp-relay.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTP id 8165D7B6; Wed, 11 Apr 2012 17:57:11 +0200 (CEST) Received: from smtp-relay.CeBiTec.Uni-Bielefeld.DE ([127.0.0.1]) by localhost (malfoy.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) (amavisd-new, port 10024) with LMTP id vjtlItoakWEm; Wed, 11 Apr 2012 17:57:08 +0200 (CEST) Received: from manam.CeBiTec.Uni-Bielefeld.DE (manam.CeBiTec.Uni-Bielefeld.DE [129.70.161.120]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp-relay.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTPS id 44AF77B5; Wed, 11 Apr 2012 17:57:08 +0200 (CEST) Received: (from ro@localhost) by manam.CeBiTec.Uni-Bielefeld.DE (8.14.5+Sun/8.14.5/Submit) id q3BFv7mI009939; Wed, 11 Apr 2012 17:57:07 +0200 (MEST) From: Rainer Orth To: Andrew Haley Cc: Richard Guenther , GCC Patches , GCJ-patches Subject: Re: jcf-reader: support for JSR 292 classfile extensions References: <4F855B49.2070605@redhat.com> <4F858523.8000607@redhat.com> Date: Wed, 11 Apr 2012 17:57:07 +0200 In-Reply-To: <4F858523.8000607@redhat.com> (Andrew Haley's message of "Wed, 11 Apr 2012 14:20:35 +0100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (usg-unix-v) MIME-Version: 1.0 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 Andrew Haley writes: > On 04/11/2012 01:43 PM, Richard Guenther wrote: >> This breaks bootstrap for me: >> >> In file included from >> /space/rguenther/src/svn/trunk/gcc/java/jcf-parse.c:1009:0: >> /space/rguenther/src/svn/trunk/gcc/java/jcf-reader.c:550:1: error: >> 'int jcf_parse_bootstrap_methods(JCF*, int)' defined but not used >> [-Werror=unused-function] >> jcf_parse_bootstrap_methods (JCF* jcf, int attribute_length ATTRIBUTE_UNUSED) >> ^ >> cc1plus: all warnings being treated as errors >> make[3]: *** [java/jcf-parse.o] Error 1 >> make[3]: *** Waiting for unfinished jobs.... >> > > Sorry. It also broke Java bootstrap on 32-bit targets: /vol/gcc/src/hg/trunk/solaris/gcc/java/jcf-dump.c: In function 'void print_constant(std::FILE*, JCF*, int, int)': /vol/gcc/src/hg/trunk/solaris/gcc/java/jcf-dump.c:929:64: error: format '%ld' expects argument of type 'long int', but argument 3 has type 'uint32 {aka unsigned int}' [-Werror=format] fprintf (out, "Fieldref: %ld=", JPOOL_USHORT2 (jcf, index)); ^ /vol/gcc/src/hg/trunk/solaris/gcc/java/jcf-dump.c:936:65: error: format '%ld' expects argument of type 'long int', but argument 3 has type 'uint32 {aka unsigned int}' [-Werror=format] fprintf (out, "Methodref: %ld=", JPOOL_USHORT2 (jcf, index)); ^ /vol/gcc/src/hg/trunk/solaris/gcc/java/jcf-dump.c:941:74: error: format '%ld' expects argument of type 'long int', but argument 3 has type 'uint32 {aka unsigned int}' [-Werror=format] fprintf (out, "InterfaceMethodref: %ld=", JPOOL_USHORT2 (jcf, index)); ^ /vol/gcc/src/hg/trunk/solaris/gcc/java/jcf-dump.c:949:62: error: format '%ld' expects argument of type 'long int', but argument 3 has type 'uint32 {aka unsigned int}' [-Werror=format] fprintf (out, "MethodType %ld: ", JPOOL_USHORT1 (jcf, index)); ^ /vol/gcc/src/hg/trunk/solaris/gcc/java/jcf-dump.c:957:68: error: format '%ld' expects argument of type 'long int', but argument 3 has type 'uint32 {aka unsigned int}' [-Werror=format] fprintf (out, "bootstrap_method: %ld ", JPOOL_USHORT1 (jcf, index)); ^ The following patch got me into stage3 on i386-pc-solaris2.10 and amd64-pc-solaris2.10. Ok for mainline? Rainer 2012-04-11 Rainer Orth * jcf-dump.c (print_constant): Cast JPOOL_USHORT2, JPOOL_USHORT1 results to long to match formats. # HG changeset patch # Parent 94918a528698bab552dc2f8be5c1666444afca67 Fix java bootstrap on 32-bit targets diff --git a/gcc/java/jcf-dump.c b/gcc/java/jcf-dump.c --- a/gcc/java/jcf-dump.c +++ b/gcc/java/jcf-dump.c @@ -926,19 +926,20 @@ print_constant (FILE *out, JCF *jcf, int case 3: case 4: if (verbosity > 0) - fprintf (out, "Fieldref: %ld=", JPOOL_USHORT2 (jcf, index)); + fprintf (out, "Fieldref: %ld=", (long) JPOOL_USHORT2 (jcf, index)); print_constant (out, jcf, JPOOL_USHORT2 (jcf, index), 0); case 5: case 6: case 7: case 8: if (verbosity > 0) - fprintf (out, "Methodref: %ld=", JPOOL_USHORT2 (jcf, index)); + fprintf (out, "Methodref: %ld=", (long) JPOOL_USHORT2 (jcf, index)); print_constant (out, jcf, JPOOL_USHORT2 (jcf, index), 0); break; case 9: if (verbosity > 0) - fprintf (out, "InterfaceMethodref: %ld=", JPOOL_USHORT2 (jcf, index)); + fprintf (out, "InterfaceMethodref: %ld=", + (long) JPOOL_USHORT2 (jcf, index)); print_constant (out, jcf, JPOOL_USHORT2 (jcf, index), 0); break; } @@ -946,7 +947,7 @@ print_constant (FILE *out, JCF *jcf, int } case CONSTANT_MethodType: if (verbosity > 0) - fprintf (out, "MethodType %ld: ", JPOOL_USHORT1 (jcf, index)); + fprintf (out, "MethodType %ld: ", (long) JPOOL_USHORT1 (jcf, index)); print_signature (out, jcf, JPOOL_USHORT1 (jcf, index), 0); break; case CONSTANT_InvokeDynamic: @@ -954,7 +955,8 @@ print_constant (FILE *out, JCF *jcf, int uint16 name_and_type = JPOOL_USHORT2 (jcf, index); if (verbosity > 0) fprintf (out, "InvokeDynamic: "); - fprintf (out, "bootstrap_method: %ld ", JPOOL_USHORT1 (jcf, index)); + fprintf (out, "bootstrap_method: %ld ", + (long) JPOOL_USHORT1 (jcf, index)); if (verbosity == 2) fprintf (out, " name_and_type: %d=<", name_and_type); print_constant_terse (out, jcf, name_and_type, CONSTANT_NameAndType);