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]

IPA merge 5: add_reference_var initializer tweek


Hi,
add_referenced_var needs to be made slightly more aggressive when SSA is built
pre-IPA, since new constant variables might be appearing, so we need to
consider more initializers to become possibly referenced by the body.

Bootstrappred/regtested i686-linux. OK?

Honza
	* tree-dfa.c (add_referenced_var): Walk initializers of
	non-constant/readonly static vars.

*** /root/trunk/gcc/tree-dfa.c	Tue Nov 28 15:20:11 2006
--- tree-dfa.c	Sat Dec  2 01:36:52 2006
*************** add_referenced_var (tree var)
*** 714,728 ****
  
        /* Scan DECL_INITIAL for pointer variables as they may contain
  	 address arithmetic referencing the address of other
! 	 variables.  */
        if (DECL_INITIAL (var)
  	  /* Initializers of external variables are not useful to the
  	     optimizers.  */
!           && !DECL_EXTERNAL (var)
! 	  /* It's not necessary to walk the initial value of non-constant
! 	     variables because it cannot be propagated by the
! 	     optimizers.  */
! 	  && (TREE_CONSTANT (var) || TREE_READONLY (var)))
        	walk_tree (&DECL_INITIAL (var), find_vars_r, NULL, 0);
      }
  }
--- 714,726 ----
  
        /* Scan DECL_INITIAL for pointer variables as they may contain
  	 address arithmetic referencing the address of other
! 	 variables.  
! 	 Even non-constant intializers needs to be walked, because
! 	 IPA passes might prove they invariantness later on.  */
        if (DECL_INITIAL (var)
  	  /* Initializers of external variables are not useful to the
  	     optimizers.  */
!           && !DECL_EXTERNAL (var))
        	walk_tree (&DECL_INITIAL (var), find_vars_r, NULL, 0);
      }
  }


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