This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: RFC: VTA alias set discrepancy
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Aldy Hernandez <aldyh at redhat dot com>
- Cc: gcc at gcc dot gnu dot org, Alexandre Oliva <aoliva at redhat dot com>
- Date: Wed, 17 Mar 2010 17:32:54 +0100
- Subject: Re: RFC: VTA alias set discrepancy
- References: <20100317160646.GA12942@redhat.com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Wed, Mar 17, 2010 at 12:06:49PM -0400, Aldy Hernandez wrote:
> What happens is that rtl_for_decl_location():dwarf2out.c will call
> make_decl_rtl() which further down the call chain will call
> get_alias_set/new_alias_set. It matters not that we reset DECL_RTL
> immediately after, we have already created a new alias set for first
> time callers:
>
> /* Try harder to get a rtl. If this symbol ends up not being emitted
> in the current CU, resolve_addr will remove the expression referencing
> it. */
> ...
> ...
> {
> rtl = DECL_RTL (decl);
> /* Reset DECL_RTL back, as various parts of the compiler expects
> DECL_RTL set meaning it is actually going to be output. */
> SET_DECL_RTL (decl, NULL);
expand_debug_expr is another such spot.
I guess best would be to make sure no new alias set is created in these
places. Perhaps
int save_strict_aliasing = flag_strict_aliasing;
flag_strict_aliasing = 0;
rtl = DECL_RTL (decl);
flag_strict_aliasing = save_strict_aliasing;
in both places?
The rtls created this way are used only for DEBUG purposes.
I bet C/C++ FEs create the alias set for the decls much earlier...
Jakub