This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: java aliasing rules
- From: Bryce McKinlay <bryce at waitaki dot otago dot ac dot nz>
- To: Dan Nicolaescu <dann at godzilla dot ics dot uci dot edu>
- Cc: java at gcc dot gnu dot org, gcc at gcc dot gnu dot org
- Date: Thu, 28 Mar 2002 11:53:27 +1200
- Subject: Re: java aliasing rules
- References: <200203271143.aa05958@gremlin-relay.ics.uci.edu>
Dan Nicolaescu wrote:
>The more general question is if 2 COMPONENT_REFs that refer to classes
>that are in conflicting alias sets (ie alias_sets_conflict_p) alias in
>java. I have a hunch that this might be true, but I don't know enough
>about java to be sure.
>
Right - Aliasing in Java is very simple, because basically there isn't
any ;-). The only case we need to be careful about is with inheritance
when two fields in different classes might actually be the same (ie if
"class second extends first").
I implemented java_get_alias_set() by simply assigning a new alias set
to every unique field, storing it in DECL_POINTER_ALIAS_SET for each
FIELD_DECL. This managed to eliminate some redundant loads in my tests,
but didn't cause any measurable improvements in benchmark scores so I
didn't get too excited about it, and I didn't get around to submitting
the patch yet. I'll try it out later on your test case and see what
happens...
regards
Bryce.