[PATCH] Fix gcj on ppc*-linux at -O0

Jakub Jelinek jakub@redhat.com
Tue Jul 29 16:53:00 GMT 2008


On Tue, Jul 29, 2008 at 09:50:25AM +0100, Andrew Haley wrote:
> > 2008-07-28  Jakub Jelinek  <jakub@redhat.com>
> > 
> > 	* class.c (build_utf8_ref): Pad initializer string to utf8const_type's
> > 	alignment.
> 
> Yes, thanks.

While that fixed libgcj.so and anything that is built with -O2,
various testcases that are built at -O0 still failed.

                === libjava Summary ===

# of expected passes            2147
# of unexpected failures        209
# of untested testcases         209

The problem is again -fsection-anchors related.  At -O0,
the _Utf* constants aren't put into the various .rodata.jutf8.*
mergeable sections, but all go into .rodata and they are offsetted
from the .LANCHOR* symbol.  While they have the desired distances
in the .rodata section, for the offsets within .rodata section
-fsection-anchors code uses DECL_SIZE_UNIT on the objects, and
that is always 4.  The attached patch fixes that by setting
DECL_SIZE{,_UNIT} on the _Utf* VAR_DECLs from the initializer's
sizes.  With this, powerpc64-linux --with-cpu=default32
bootstraps and make check-target-libjava gives:

                === libjava Summary ===

# of expected passes            2572
# of unexpected failures        1
# of untested testcases         1

Ok for trunk?

2008-07-29  Jakub Jelinek  <jakub@redhat.com>

	* class.c (build_utf8_ref): Set DECL_SIZE and DECL_SIZE_UNIT
	from ctype's sizes.

--- gcc/java/class.c.jj	2008-07-19 22:06:59.000000000 +0200
+++ gcc/java/class.c	2008-07-28 22:53:31.000000000 +0200
@@ -988,6 +990,8 @@ build_utf8_ref (tree name)
 
   TREE_CHAIN (decl) = utf8_decl_list;
   layout_decl (decl, 0);
+  DECL_SIZE (decl) = TYPE_SIZE (ctype);
+  DECL_SIZE_UNIT (decl) = TYPE_SIZE_UNIT (ctype);
   pushdecl (decl);
   rest_of_decl_compilation (decl, global_bindings_p (), 0);
   varpool_mark_needed_node (varpool_node (decl));


	Jakub



More information about the Gcc-patches mailing list