This is the mail archive of the
mailing list for the GCC project.
Re: fix rtl-opt/15289, part 1
- From: kenner at vlsi1 dot ultra dot nyu dot edu (Richard Kenner)
- To: rth at redhat dot com
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 29 Nov 04 23:58:30 EST
- Subject: Re: fix rtl-opt/15289, part 1
Which is nicely sympathetic with a previously stated goal that
get_inner_reference should handle REAL/IMAGPART_EXPR simply because
doing so is very like handling COMPONENT_REF, and that many places
that check handled_component_p were having to check for these codes
separately by hand.
This was on my list too. Thanks for getting to it.
Side note: In looking at all the places that reference handled_component_p,
I came across can_address_p, and a very curious test therein. Namely,
&& get_alias_set (TREE_TYPE (TREE_OPERAND (t, 0))) != 0
which says that an aggregate with alias set zero cannot be addressed.
Kenner added this test here:
date: 2001/10/23 18:51:00; author: kenner; state: Exp; lines: +21 -23
* alias.c (can_address_p): Compnonents are not addressable if
the containing type has alias set 0.
[ rest of very large changelog elided ]
Given that I believe can_address_p to be of the form "return true unless
you know for certain that it isn't", I believe it to be safe to arbitrarily
remove this test.
This is actually needed for correctness, though I clearly should have
commented it better since it took me a good amount of mucking around
to recall why this is. I don't think it has anything to do with Ada,
but am not sure.
Unfortunately, it's a bit of a mess. The issue is that when you say you
can "address" a field, the alias set used for the reference to the field
is that of the type of the field. That's set up to conflict with the alias
set of the record because record_component_aliases makes the subset relation
for addressable fields.
But if the alias set of the record is alias set zero, that's the alias set
the needs to be used for all references into the record, including those
of addressable components. This was the way to do that.
However, I also later added MEM_KEEP_ALIAS_SET_P and tests for MEM_ALIAS_SET
being zero in code that calls set_mem_alias_set. That *may* be enough,
but I'm not sure since get_alias_set of such a reference would return
the alias set of the field type, not alias set 0 if the field is