From patchwork Sat May 4 00:03:34 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Modra X-Patchwork-Id: 241413 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]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "localhost", Issuer "www.qmailtoaster.com" (not verified)) by ozlabs.org (Postfix) with ESMTPS id DA9912C00DD for ; Sat, 4 May 2013 10:03:50 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; q=dns; s=default; b=yJGWSksemDtcZueKz d4v7g5B3Fu0dSWoGR3IpvY/a79qaOdzmav9hznoS08LbX38rmwzu0CUQmBSARuF0 NdrHe9TXeFyybvnp4itIegSkaMfLTiKbHBGjY3k5dudd89dLSYw8Cb+QUiR8qzg8 WkDAQB+YGM69HKSYE6u32lL/Us= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=default; bh=mW6OGaq0rvN8SyjVJ/rVM1N G8zA=; b=sxihe45AbttSP1+/qJlccG1yGSXG0NGJiIy0pXL3Uje69H7zOFw5cZ0 PLXSOKMKyoPGlVbaqSTeFIIUVZC6JIVnn37eMDCW5DjbD/1lgb2gSbrODF0agRdu uh4p4HMLO2pbNA0kUgN/TcyAjrC7Fm4YCzpvZAxSHLqYTN0VmwU0= Received: (qmail 14259 invoked by alias); 4 May 2013 00:03:43 -0000 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 Received: (qmail 14234 invoked by uid 89); 4 May 2013 00:03:43 -0000 X-Spam-SWARE-Status: No, score=-1.3 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, KAM_STOCKGEN, RCVD_IN_DNSWL_NONE, RCVD_IN_HOSTKARMA_YE, SPF_PASS, TW_FJ autolearn=no version=3.3.1 Received: from mail-pd0-f176.google.com (HELO mail-pd0-f176.google.com) (209.85.192.176) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Sat, 04 May 2013 00:03:42 +0000 Received: by mail-pd0-f176.google.com with SMTP id x10so1148326pdj.7 for ; Fri, 03 May 2013 17:03:40 -0700 (PDT) X-Received: by 10.68.171.196 with SMTP id aw4mr15924001pbc.78.1367625820722; Fri, 03 May 2013 17:03:40 -0700 (PDT) Received: from bubble.grove.modra.org ([101.166.26.37]) by mx.google.com with ESMTPSA id qb1sm13416710pbb.33.2013.05.03.17.03.38 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 03 May 2013 17:03:39 -0700 (PDT) Received: by bubble.grove.modra.org (Postfix, from userid 1000) id 3DE23EA2C6B; Sat, 4 May 2013 09:33:34 +0930 (CST) Date: Sat, 4 May 2013 09:33:34 +0930 From: Alan Modra To: Jakub Jelinek Cc: Andrew Haley , Tom Tromey , gcc-patches@gcc.gnu.org Subject: Re: [PATCH] Fix array sizes created by Java FE (PR libgcj/57074) Message-ID: <20130504000334.GQ5221@bubble.grove.modra.org> Mail-Followup-To: Jakub Jelinek , Andrew Haley , Tom Tromey , gcc-patches@gcc.gnu.org References: <20130503171015.GD28963@tucnak.redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20130503171015.GD28963@tucnak.redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Virus-Found: No On Fri, May 03, 2013 at 07:10:15PM +0200, Jakub Jelinek wrote: > Fixed thusly, bootstrapped/regtested on x86_64-linux and i686-linux, but > not tested on powerpc32 where it actually caused runtime issues, can > somebody please try it there? Ok for trunk/4.8? /home/amodra/build/gcc-current/./gcc/gcj -B/home/amodra/build/gcc-current/powerpc-linux/64/libjava/ -B/home/amodra/build/gcc-current/powerpc-linux/64/libjava/ -B/home/amodra/build/gcc-current/./gcc/ -B/home/amodra/gnu/powerpc-linux/bin/ -B/home/amodra/gnu/powerpc-linux/lib/ -isystem /home/amodra/gnu/powerpc-linux/include -isystem /home/amodra/gnu/powerpc-linux/sys-include -m64 -fclasspath= -fbootclasspath=/home/amodra/src/gcc-current/libjava/classpath/lib --encoding=UTF-8 -Wno-deprecated -fbootstrap-classes -g -O2 -m64 -fsource-filename=/home/amodra/build/gcc-current/powerpc-linux/64/libjava/classpath/lib/classes -fjni -findirect-dispatch -fno-indirect-classes -c @gnu-CORBA.list -fPIC -o .libs/gnu-CORBA.o -v -save-temps Looks like this is not the only problem. Using the attached patch to verify section anchor block layout leads me to .org .LANCB76+23560 .type _atable_syms_gnu_CORBA_NamingService_NameValidator, @object .size _atable_syms_gnu_CORBA_NamingService_NameValidator, 96 _atable_syms_gnu_CORBA_NamingService_NameValidator: .quad _Utf42 .quad _Utf34 .quad _Utf35 .quad _Utf3318.82185 .quad _Utf34 .quad _Utf170 .quad _Utf293 .quad _Utf34 .quad _Utf170 .quad 0 .quad 0 .quad 0 .org .LANCB76+23608 The difference between .org's is 48, but the actual size 96. The next _atable in this file shows 48/72. PR libcgj/57074 * varasm.c (output_object_block): Use .org for each item in section anchor block rather than padding. Index: gcc/varasm.c =================================================================== --- gcc/varasm.c (revision 198274) +++ gcc/varasm.c (working copy) @@ -7095,6 +7105,10 @@ HOST_WIDE_INT offset; tree decl; rtx symbol; +#if HAVE_GNU_AS + static int labelno; + char buf[30]; +#endif if (!block->objects) return; @@ -7104,6 +7118,12 @@ switch_to_section (block->sect); assemble_align (block->alignment); +#if HAVE_GNU_AS + ASM_GENERATE_INTERNAL_LABEL (buf, "LANCB", labelno); + ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, buf); + ++labelno; +#endif + /* Define the values of all anchors relative to the current section position. */ FOR_EACH_VEC_SAFE_ELT (block->anchors, i, symbol) @@ -7114,7 +7134,14 @@ FOR_EACH_VEC_ELT (*block->objects, i, symbol) { /* Move to the object's offset, padding with zeros if necessary. */ +#if HAVE_GNU_AS + fprintf (asm_out_file, "\t.org "); + assemble_name_raw (asm_out_file, buf); + fprintf (asm_out_file, "+" HOST_WIDE_INT_PRINT_DEC "\n", + SYMBOL_REF_BLOCK_OFFSET (symbol)); +#else assemble_zeros (SYMBOL_REF_BLOCK_OFFSET (symbol) - offset); +#endif offset = SYMBOL_REF_BLOCK_OFFSET (symbol); if (CONSTANT_POOL_ADDRESS_P (symbol)) { @@ -7154,6 +7181,7 @@ } } } + gcc_checking_assert (offset == block->size); } /* A htab_traverse callback used to call output_object_block for