This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[tree-ssa-branch] Don't use DECL_CONTEXT [patch]


As per Jason's suggestion.

Bootstrapped and tested on x86.


Diego.

	* tree-dfa.c (add_call_site_clobbers): Call decl_function_context
	instead of DECL_CONTEXT.
	* tree-ssa-ccp.c (initialize): Ditto.
	* tree-ssa.c (analyze_rdefs): Ditto.

Index: tree-dfa.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-dfa.c,v
retrieving revision 1.1.4.15
diff -d -u -p -r1.1.4.15 tree-dfa.c
--- tree-dfa.c	12 Sep 2002 11:03:15 -0000	1.1.4.15
+++ tree-dfa.c	13 Sep 2002 17:40:38 -0000
@@ -1449,7 +1449,7 @@ add_call_site_clobbers ()
 	  /* Add global _DECLs and addressable _DECLs (only if the function
 	     receives pointer arguments).  */
 	  if ((add_addressable && TREE_ADDRESSABLE (sym))
-	      || DECL_CONTEXT (sym) == NULL)
+	      || decl_function_context (sym) == NULL)
 	    {
 	      struct ref_list_node *call_ref_node;
 	      tree_ref clobber, may_use;
Index: tree-ssa-ccp.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-ssa-ccp.c,v
retrieving revision 1.1.2.16
diff -d -u -p -r1.1.2.16 tree-ssa-ccp.c
--- tree-ssa-ccp.c	11 Sep 2002 01:13:35 -0000	1.1.2.16
+++ tree-ssa-ccp.c	13 Sep 2002 17:40:38 -0000
@@ -941,7 +941,8 @@ initialize ()
 
 	  /* Default definitions for incoming parameters and global
 	     variables should be considered varying.  */
-	  if ((TREE_CODE (var) == PARM_DECL || DECL_CONTEXT (var) == NULL)
+	  if ((TREE_CODE (var) == PARM_DECL
+	       || decl_function_context (var) == NULL)
 	      && ref_type (r) == (V_DEF | M_DEFAULT))
 	    values[id].lattice_val = VARYING;
 
Index: tree-ssa.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-ssa.c,v
retrieving revision 1.1.4.15
diff -d -u -p -r1.1.4.15 tree-ssa.c
--- tree-ssa.c	11 Sep 2002 01:13:35 -0000	1.1.4.15
+++ tree-ssa.c	13 Sep 2002 17:40:38 -0000
@@ -492,7 +492,7 @@ analyze_rdefs ()
       /* Uninitialized warning messages are only given for local variables
 	 with auto declarations.  */
       if (TREE_CODE (var) != VAR_DECL
-	  || DECL_CONTEXT (var) == NULL
+	  || decl_function_context (var) == NULL
 	  || TREE_STATIC (var)
 	  || TREE_ADDRESSABLE (var))
 	continue;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]