This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: gcj: always emit static array data
- To: green at cygnus dot com
- Subject: Re: gcj: always emit static array data
- From: Andrew Haley <aph at pasanda dot cygnus dot co dot uk>
- Date: 16 Aug 1999 14:02:00 -0000
- CC: gcc-patches at sourceware dot cygnus dot com
> Date: Mon, 16 Aug 1999 06:58:32 -0700
> From: Anthony Green <green@cygnus.com>
>
> Andrew wrote:
> > Well, okay. However, this is surely just papering over the cracks in
> > the wall: surely we should find out *why* we need to output an array
> > which is inaccessible. Is it because class metadata refers to it?
>
> The array is being used in the class initialization code.
>
> In this case...
>
> public class Foo
> {
> private final static int[] a = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
> public static void main (String[] args) {}
> }
>
> ...the compiler generates a class initialization routine which
> allocates a new array with _Jv_NewArray. The data is then copied into
> this array.
So we should stop the compiler from referring to the array in the
class initialization routine, n'est ce pas? We are initializing an
unreachable array...
Andrew.