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]: Fix a few small PTA problems


2004-01-16 Daniel Berlin <dberlin@dberlin.org>

	* tree-alias-common.c (get_alias_var): Handle BIT_FIELD_REF.
	(find_func_aliases): Ditto.
  	Update for fact that basic component_refs are no longer
	is_gimple_variable.
	(create_fun_alias_var): Set DECL_CONTEXT on our faked declarations.
	(create_alias_vars): HAVE_BANSHEE is either 1 or non-existent, so
	it needs to be an ifdef.
	(pass_build_pta): PTA dumps info, so it needs a name.
	(pass_del_pta): Same.

Index: tree-alias-common.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-alias-common.c,v
retrieving revision 1.1.2.48
diff -u -3 -p -r1.1.2.48 tree-alias-common.c
--- tree-alias-common.c	12 Jan 2004 23:39:32 -0000	1.1.2.48
+++ tree-alias-common.c	16 Jan 2004 14:34:01 -0000
@@ -258,6 +258,7 @@ get_alias_var (tree expr)
     case FIX_ROUND_EXPR:
     case ADDR_EXPR:
     case INDIRECT_REF:
+    case BIT_FIELD_REF:
       /* If it's a ref or cast or conversion of something, get the
          alias var of the something. */
       return get_alias_var (TREE_OPERAND (expr, 0));
@@ -440,6 +441,10 @@ find_func_aliases (tree stp)
 	{
 	  op1 = TREE_OPERAND (op1, 0);
 	}
+      while (TREE_CODE (op1) == BIT_FIELD_REF)
+	{
+	  op1 = TREE_OPERAND (op1, 0);
+	}
 #endif

       /* You would think we could test rhsAV at the top, rather than
@@ -453,13 +458,20 @@ find_func_aliases (tree stp)
       /* x = <something> */
       if (is_gimple_variable (op0))
 	{
-	  /* x = y or x = foo.y */
+	  /* x = y */
 	  if (is_gimple_variable (op1))
 	    {
 	      if (rhsAV != NULL)
 		current_alias_ops->simple_assign (current_alias_ops, lhsAV,
 						  rhsAV);
 	    }
+	  else if (TREE_CODE (op1) == COMPONENT_REF
+		   && DECL_P (TREE_OPERAND (op1, 0)))
+	    {
+	         if (rhsAV != NULL)
+		current_alias_ops->simple_assign (current_alias_ops, lhsAV,
+						  rhsAV);
+	    }
 	  /* x = (cast) [maybe-addr-expr] y */
 	  else if (is_gimple_cast (op1))
 	    {
@@ -760,6 +774,7 @@ create_fun_alias_var (tree decl, int for
 	{
 	  tree fakedecl = create_tmp_var_raw (TREE_VALUE (arg), "normarg");
 	  alias_typevar tvar;
+	  DECL_CONTEXT (fakedecl) = current_function_decl;
 	  tvar = get_alias_var (fakedecl);
 	  VARRAY_PUSH_GENERIC_PTR (params, tvar);

@@ -919,10 +934,11 @@ static void
 create_alias_vars (void)
 {
   basic_block bb;
-
-  if (HAVE_BANSHEE && flag_tree_points_to == PTA_ANDERSEN)
+#ifdef HAVE_BANSHEE
+  if (flag_tree_points_to == PTA_ANDERSEN)
     current_alias_ops = andersen_alias_ops;
   else
+#endif
    {
      current_alias_ops = NULL;
      flag_tree_points_to = PTA_NONE;
@@ -970,7 +986,7 @@ create_alias_vars (void)

 struct tree_opt_pass pass_build_pta =
 {
-  NULL,					/* name */
+  "pta",				/* name */
   NULL,					/* gate */
   create_alias_vars,			/* execute */
   NULL,					/* sub */
@@ -1018,7 +1034,7 @@ delete_alias_vars (void)

 struct tree_opt_pass pass_del_pta =
 {
-  NULL,					/* name */
+  "pta",				/* name */
   NULL,					/* gate */
   delete_alias_vars,			/* execute */
   NULL,					/* sub */


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