GCC 4.2.0 Status Report (2007-03-22)

Diego Novillo dnovillo@redhat.com
Fri Mar 30 16:33:00 GMT 2007


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.



More information about the Gcc mailing list