This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: gcj: always emit static array data


> 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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]