This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [gij] Fix array accesses
- From: Andrew Pinski <pinskia at gmail dot com>
- To: Andrew Haley <aph at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org, java-patches at gcc dot gnu dot org
- Date: Tue, 09 Jan 2007 10:32:35 -0800
- Subject: Re: [gij] Fix array accesses
- References: <17827.47534.865035.972871@zebedee.pink>
On Tue, 2007-01-09 at 15:50 +0000, Andrew Haley wrote:
> This patch changes code generations fo arrays in libgcj; it generates
>
> *((elemtype)(&array->data) + index*size_exp)
>
> instead of
>
> (array->data)[n]
>
> Now, you might say "That's the same thing." Well, it is, kinda sorta,
> but the array is defined as something like
>
> typedef struct jcharArray
> {
> short length;
> jchar data[];
> } jcharArray;
Both of these should mean the same thing to IR, and if they don't there
is a bug else also.
I wonder if this failure of the aliasing issue is related to
"gcc.c-torture/execute/pr15262-1.c" failing at -O2 also.
Thanks,
Andrew Pinski