------- Additional Comments From dnovillo at gcc dot gnu dot org  2005-02-14 
15:20 -------
(In reply to comment #3)

> I'm not sure how to do anything but run a brand-new alias pass here and 
> anywhere
> else we expose new global variables (e.g DOM?).

Perhaps the easiest approach for 4.0 is to notice the variable very early.  When
scanning for variables, we scan the DECL_INITIAL expressions for pointer-types,
but in this case we don't because 'const_test' is a non-pointer.

With this patch, the test works because we add 'global_int' even before going
into SSA form.  I don't think we should worry too much about introducing the
symbol too early.  This case should not be very common.

Thoughts?

Index: tree-dfa.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-dfa.c,v
retrieving revision 2.44
diff -d -u -p -r2.44 tree-dfa.c
--- tree-dfa.c  10 Dec 2004 21:54:41 -0000      2.44
+++ tree-dfa.c  14 Feb 2005 15:19:42 -0000
@@ -901,8 +901,7 @@ add_referenced_var (tree var, struct wal
       /* Scan DECL_INITIAL for pointer variables as they may contain
         address arithmetic referencing the address of other
         variables.  */
-      if (DECL_INITIAL (var)
-         && POINTER_TYPE_P (TREE_TYPE (var)))
+      if (DECL_INITIAL (var))
        walk_tree (&DECL_INITIAL (var), find_vars_r, walk_state, 0);
     }
 }


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |dnovillo at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19853

Reply via email to