gcj/340: Static array initializer link failure with -O
Bryce McKinlay
bryce@albatross.co.nz
Sun Oct 8 18:30:00 GMT 2000
The following reply was made to PR gcj/340; it has been noted by GNATS.
From: Bryce McKinlay <bryce@albatross.co.nz>
To: java-gnats@sourceware.cygnus.com
Cc:
Subject: Re: gcj/340: Static array initializer link failure with -O
Date: Mon, 09 Oct 2000 14:30:26 +1300
bryce@albatross.co.nz wrote:
> $ gcj ArrayInit.java -o ai --main=ArrayInit -O
> /tmp/ccmJthip.o: In function `ArrayInit::_003cclinit_003e(unsigned)':
> /tmp/ccmJthip.o(.text+0x99): undefined reference to `LJv0'
> collect2: ld returned 1 exit status
This bug is still present in the current compiler.
Here is my workaround:
Index: expr.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/java/expr.c,v
retrieving revision 1.87
diff -u -r1.87 expr.c
--- expr.c 2000/10/05 07:17:34 1.87
+++ expr.c 2000/10/09 01:27:02
@@ -2328,6 +2328,7 @@
tree init = TREE_OPERAND (exp, 0);
tree array_decl;
+#if 0
/* See if we can generate the array statically. */
if (TREE_CONSTANT (init) && TREE_STATIC (exp)
&& JPRIMITIVE_TYPE_P (element_type))
@@ -2361,6 +2362,7 @@
pop_obstacks ();
return r;
}
+#endif
array_decl = build_decl (VAR_DECL, NULL_TREE, TREE_TYPE (exp));
expand_decl (array_decl);
[ bryce ]
More information about the Java-prs
mailing list