This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: GCC 4.2.0 Status Report (2007-03-22)
- From: Diego Novillo <dnovillo at redhat dot com>
- To: Jason Merrill <jason at redhat dot com>
- Cc: Mark Mitchell <mark at codesourcery dot com>, gcc at gcc dot gnu dot org, Roger Sayle <roger at eyesopen dot com>, "Joseph S. Myers" <joseph at codesourcery dot com>
- Date: Fri, 30 Mar 2007 12:04:47 -0400
- Subject: Re: GCC 4.2.0 Status Report (2007-03-22)
- References: <460336F9.7030208@codesourcery.com> <460D0941.2050008@redhat.com> <460D30A0.9050805@redhat.com>
Jason Merrill wrote on 03/30/07 11:45:
> Looks fine to me. Many places in the front end use build_address rather
> than build1 (ADDR_EXPR) to avoid this issue.
Yeah, I found other cases in Java and in c-*.c. In one case, we are
building the address of a LABEL_DECL for a computed goto
(finish_label_address_expr).
Interestingly enough, mark_addressable refuses to mark the label as
addressable, but we need the label addressable so that it's processed
properly by the compute_may_aliases machinery.
Given that we need to be very consistent about addressability marking in
the FEs, wouldn't we be better off doing this in build1_stat()?
Index: tree.c
===================================================================
--- tree.c (revision 123332)
+++ tree.c (working copy)
@@ -2922,7 +2922,11 @@ build1_stat (enum tree_code code, tree t
case ADDR_EXPR:
if (node)
- recompute_tree_invariant_for_addr_expr (t);
+ {
+ recompute_tree_invariant_for_addr_expr (t);
+ if (DECL_P (node))
+ TREE_ADDRESSABLE (node) = 1;
+ }
break;
default:
Thanks.