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]

Remove aliases_computed_p


Removes the hack we used to get around the lack of aliasing information
in the early passes.  It makes more sense to go out and actually compute
aliasing after the SSA form has been built.  After all, we can always
refine it later and it avoids all the hackish workarounds we used to
have in get_expr_operands and friends.

I had to adjust some test cases because we are now doing a slightly
better job.  I also tripped the alias verifier a couple more times.

Most of the changes are mechanical.  We now have PROP_alias, which just
about every optimizer pass depends on.  This will prevent future changes
from scheduling passes before aliases have been computed.


Bootstrapped and tested x86 and ppc.


Diego.

	* tree-optimize.c (init_tree_optimization_passes): Schedule
	pass_may_alias right after the program is renamed into SSA.
	* tree-pass.h (PROP_alias): Define.
	* tree-outof-ssa.c (pass_del_ssa): Require PROP_alias.
	* tree-sra.c (pass_sra): Likewise.
	* tree-ssa-ccp.c (pass_ccp): Likewise.
	* tree-ssa-copyrename.c (pass_rename_ssa_ccp): Likewise.
	* tree-ssa-dce.c (pass_dce): Likewise.
	* tree-ssa-dom.c (pass_dominator): Likewise.
	* tree-ssa-dse.c (pass_dse): Likewise.
	* tree-ssa-forwprop.c (pass_forwprop): Likewise.
	* tree-ssa-loop-ch.c (pass_ch): Likewise.
	* tree-ssa-phiopt.c (pass_phiopt): Likewise.
	* tree-ssa-pre.c (pass_pre): Likewise.
	* tree-tailcall.c (pass_tail_recursion): Likewise.
	* tree-ssa.c (pass_redundant_phi): Likewise.
	* tree-ssa-alias.c (aliases_computed_p): Remove.
	Update all users.
	(init_alias_info): Do not mark all type tags for renaming
	unconditionally.
	Clear may_aliases from every symbol.
	(setup_pointers_and_addressables): If a pointer has not been
	dereferenced and it had a type tag, clear it and mark the old
	tag for renaming.

testsuite/ChangeLog

	* gcc.dg/tree-ssa/20030714-2.c: Adjust number of expected
	conditionals.
	* gcc.dg/tree-ssa/20031022-1.c: Adjust number of expected
	loads.
	* gcc.dg/tree-ssa/ssa-dom-cse-1.c: Expect optimization in
	DOM1.

Index: tree-optimize.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-optimize.c,v
retrieving revision 2.33
diff -d -c -p -r2.33 tree-optimize.c
*** tree-optimize.c	27 Jul 2004 18:32:49 -0000	2.33
--- tree-optimize.c	28 Jul 2004 04:15:24 -0000
*************** init_tree_optimization_passes (void)
*** 321,326 ****
--- 321,327 ----
    NEXT_PASS (pass_referenced_vars);
    NEXT_PASS (pass_build_pta);
    NEXT_PASS (pass_build_ssa);
+   NEXT_PASS (pass_may_alias);
    NEXT_PASS (pass_rename_ssa_copies);
    NEXT_PASS (pass_early_warn_uninitialized);
    NEXT_PASS (pass_dce);
Index: tree-outof-ssa.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-outof-ssa.c,v
retrieving revision 2.12
diff -d -c -p -r2.12 tree-outof-ssa.c
*** tree-outof-ssa.c	26 Jun 2004 21:11:12 -0000	2.12
--- tree-outof-ssa.c	28 Jul 2004 04:15:25 -0000
*************** struct tree_opt_pass pass_del_ssa = 
*** 2213,2219 ****
    NULL,					/* next */
    0,					/* static_pass_number */
    TV_TREE_SSA_TO_NORMAL,		/* tv_id */
!   PROP_cfg | PROP_ssa,			/* properties_required */
    0,					/* properties_provided */
    /* ??? If TER is enabled, we also kill gimple.  */
    PROP_ssa,				/* properties_destroyed */
--- 2213,2219 ----
    NULL,					/* next */
    0,					/* static_pass_number */
    TV_TREE_SSA_TO_NORMAL,		/* tv_id */
!   PROP_cfg | PROP_ssa | PROP_alias,	/* properties_required */
    0,					/* properties_provided */
    /* ??? If TER is enabled, we also kill gimple.  */
    PROP_ssa,				/* properties_destroyed */
Index: tree-pass.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-pass.h,v
retrieving revision 2.7
diff -d -c -p -r2.7 tree-pass.h
*** tree-pass.h	27 Jul 2004 18:32:50 -0000	2.7
--- tree-pass.h	28 Jul 2004 04:15:25 -0000
*************** struct tree_opt_pass
*** 76,81 ****
--- 76,82 ----
  #define PROP_ssa		(1 << 6)
  #define PROP_no_crit_edges      (1 << 7)
  #define PROP_rtl		(1 << 8)
+ #define PROP_alias		(1 << 9)
  
  #define PROP_trees \
    (PROP_gimple_any | PROP_gimple_lcf | PROP_gimple_leh)
Index: tree-sra.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-sra.c,v
retrieving revision 2.21
diff -d -c -p -r2.21 tree-sra.c
*** tree-sra.c	16 Jul 2004 21:13:03 -0000	2.21
--- tree-sra.c	28 Jul 2004 04:15:25 -0000
*************** struct tree_opt_pass pass_sra = 
*** 2118,2124 ****
    NULL,					/* next */
    0,					/* static_pass_number */
    TV_TREE_SRA,				/* tv_id */
!   PROP_cfg | PROP_ssa,			/* properties_required */
    0,					/* properties_provided */
    0,					/* properties_destroyed */
    0,					/* todo_flags_start */
--- 2118,2124 ----
    NULL,					/* next */
    0,					/* static_pass_number */
    TV_TREE_SRA,				/* tv_id */
!   PROP_cfg | PROP_ssa | PROP_alias,	/* properties_required */
    0,					/* properties_provided */
    0,					/* properties_destroyed */
    0,					/* todo_flags_start */
Index: tree-ssa-alias.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssa-alias.c,v
retrieving revision 2.17
diff -d -c -p -r2.17 tree-ssa-alias.c
*** tree-ssa-alias.c	27 Jul 2004 15:32:44 -0000	2.17
--- tree-ssa-alias.c	28 Jul 2004 04:15:26 -0000
*************** bitmap call_clobbered_vars;
*** 175,187 ****
     variable).  */
  bitmap addressable_vars;
  
- /* 'true' after aliases have been computed (see compute_may_aliases).  This
-    is used by get_stmt_operands and its helpers to determine what to do
-    when scanning an operand for a variable that may be aliased.  If
-    may-alias information is still not available, the statement is marked as
-    having volatile operands.  */
- bool aliases_computed_p;
- 
  /* When the program has too many call-clobbered variables and call-sites,
     this variable is used to represent the clobbering effects of function
     calls.  In these cases, all the call clobbered variables in the program
--- 175,180 ----
*************** compute_may_aliases (void)
*** 350,358 ****
  
    /* Deallocate memory used by aliasing data structures.  */
    delete_alias_info (ai);
- 
-   /* Indicate that may-alias information is now available.  */
-   aliases_computed_p = true;
  }
  
  struct tree_opt_pass pass_may_alias = 
--- 343,348 ----
*************** struct tree_opt_pass pass_may_alias = 
*** 365,371 ****
    0,					/* static_pass_number */
    TV_TREE_MAY_ALIAS,			/* tv_id */
    PROP_cfg | PROP_ssa | PROP_pta,	/* properties_required */
!   0,					/* properties_provided */
    0,					/* properties_destroyed */
    0,					/* todo_flags_start */
    TODO_dump_func | TODO_rename_vars
--- 355,361 ----
    0,					/* static_pass_number */
    TV_TREE_MAY_ALIAS,			/* tv_id */
    PROP_cfg | PROP_ssa | PROP_pta,	/* properties_required */
!   PROP_alias,				/* properties_provided */
    0,					/* properties_destroyed */
    0,					/* todo_flags_start */
    TODO_dump_func | TODO_rename_vars
*************** static struct alias_info *
*** 379,384 ****
--- 369,375 ----
  init_alias_info (void)
  {
    struct alias_info *ai;
+   static bool aliases_computed_p = false;
  
    ai = xcalloc (1, sizeof (struct alias_info));
    ai->ssa_names_visited = BITMAP_XMALLOC ();
*************** init_alias_info (void)
*** 417,430 ****
        for (i = 0; i < num_referenced_vars; i++)
  	{
  	  var_ann_t ann = var_ann (referenced_var (i));
- 
  	  ann->is_alias_tag = 0;
! 	  if (ann->type_mem_tag)
! 	    {
! 	      var_ann_t tag_ann = var_ann (ann->type_mem_tag);
! 	      tag_ann->may_aliases = NULL;
! 	      bitmap_set_bit (vars_to_rename, tag_ann->uid);
! 	    }
  	}
  
        /* Clear flow-sensitive points-to information from each SSA name.  */
--- 408,415 ----
        for (i = 0; i < num_referenced_vars; i++)
  	{
  	  var_ann_t ann = var_ann (referenced_var (i));
  	  ann->is_alias_tag = 0;
! 	  ann->may_aliases = NULL;
  	}
  
        /* Clear flow-sensitive points-to information from each SSA name.  */
*************** init_alias_info (void)
*** 450,461 ****
  	      pi->is_dereferenced = 0;
  	      if (pi->pt_vars)
  		bitmap_clear (pi->pt_vars);
- 	      if (pi->name_mem_tag)
- 		var_ann (pi->name_mem_tag)->may_aliases = NULL;
  	    }
  	}
      }
  
    return ai;
  }
  
--- 435,447 ----
  	      pi->is_dereferenced = 0;
  	      if (pi->pt_vars)
  		bitmap_clear (pi->pt_vars);
  	    }
  	}
      }
  
+   /* Next time, we will need to reset alias information.  */
+   aliases_computed_p = true;
+ 
    return ai;
  }
  
*************** setup_pointers_and_addressables (struct 
*** 1375,1421 ****
  
        /* Add pointer variables that have been dereferenced to the POINTERS
           array and create a type memory tag for them.  */
!       if (POINTER_TYPE_P (TREE_TYPE (var))
! 	  && (bitmap_bit_p (ai->dereferenced_ptrs_store, v_ann->uid)
! 	      || bitmap_bit_p (ai->dereferenced_ptrs_load, v_ann->uid)))
  	{
! 	  tree tag;
! 	  var_ann_t t_ann;
  
! 	  /* If pointer VAR still doesn't have a memory tag associated
! 	     with it, create it now or re-use an existing one.  */
! 	  tag = get_tmt_for (var, ai);
! 	  t_ann = var_ann (tag);
  
! 	  /* The type tag will need to be renamed into SSA afterwards.
! 	     Note that we cannot do this inside get_tmt_for because
! 	     aliasing may run multiple times and we only create type
! 	     tags the first time.  */
! 	  bitmap_set_bit (vars_to_rename, t_ann->uid);
  
! 	  /* Associate the tag with pointer VAR.  */
! 	  v_ann->type_mem_tag = tag;
  
! 	  /* If pointer VAR has been used in a store operation, then its
! 	     memory tag must be marked as written-to.  */
! 	  if (bitmap_bit_p (ai->dereferenced_ptrs_store, v_ann->uid))
! 	    bitmap_set_bit (ai->written_vars, t_ann->uid);
  
! 	  /* If pointer VAR is a global variable or a PARM_DECL, then its
! 	     memory tag should be considered a global variable.  */
! 	  if (TREE_CODE (var) == PARM_DECL || needs_to_live_in_memory (var))
! 	    mark_call_clobbered (tag);
  
! 	  /* All the dereferences of pointer VAR count as references of
! 	     TAG.  Since TAG can be associated with several pointers, add
! 	     the dereferences of VAR to the TAG.  We may need to grow
! 	     AI->NUM_REFERENCES because we have been adding name and
! 	     type tags.  */
! 	  if (t_ann->uid >= VARRAY_SIZE (ai->num_references))
! 	    VARRAY_GROW (ai->num_references, t_ann->uid + 10);
  
! 	  VARRAY_UINT (ai->num_references, t_ann->uid)
! 	      += VARRAY_UINT (ai->num_references, v_ann->uid);
  	}
      }
  
--- 1361,1424 ----
  
        /* Add pointer variables that have been dereferenced to the POINTERS
           array and create a type memory tag for them.  */
!       if (POINTER_TYPE_P (TREE_TYPE (var)))
  	{
! 	  if ((bitmap_bit_p (ai->dereferenced_ptrs_store, v_ann->uid)
! 		|| bitmap_bit_p (ai->dereferenced_ptrs_load, v_ann->uid)))
! 	    {
! 	      tree tag;
! 	      var_ann_t t_ann;
  
! 	      /* If pointer VAR still doesn't have a memory tag
! 		 associated with it, create it now or re-use an
! 		 existing one.  */
! 	      tag = get_tmt_for (var, ai);
! 	      t_ann = var_ann (tag);
  
! 	      /* The type tag will need to be renamed into SSA
! 		 afterwards. Note that we cannot do this inside
! 		 get_tmt_for because aliasing may run multiple times
! 		 and we only create type tags the first time.  */
! 	      bitmap_set_bit (vars_to_rename, t_ann->uid);
  
! 	      /* Associate the tag with pointer VAR.  */
! 	      v_ann->type_mem_tag = tag;
  
! 	      /* If pointer VAR has been used in a store operation,
! 		 then its memory tag must be marked as written-to.  */
! 	      if (bitmap_bit_p (ai->dereferenced_ptrs_store, v_ann->uid))
! 		bitmap_set_bit (ai->written_vars, t_ann->uid);
  
! 	      /* If pointer VAR is a global variable or a PARM_DECL,
! 		 then its memory tag should be considered a global
! 		 variable.  */
! 	      if (TREE_CODE (var) == PARM_DECL || needs_to_live_in_memory (var))
! 		mark_call_clobbered (tag);
  
! 	      /* All the dereferences of pointer VAR count as
! 		 references of TAG.  Since TAG can be associated with
! 		 several pointers, add the dereferences of VAR to the
! 		 TAG.  We may need to grow AI->NUM_REFERENCES because
! 		 we have been adding name and type tags.  */
! 	      if (t_ann->uid >= VARRAY_SIZE (ai->num_references))
! 		VARRAY_GROW (ai->num_references, t_ann->uid + 10);
  
! 	      VARRAY_UINT (ai->num_references, t_ann->uid)
! 		+= VARRAY_UINT (ai->num_references, v_ann->uid);
! 	    }
! 	  else
! 	    {
! 	      /* The pointer has not been dereferenced.  If it had a
! 		 type memory tag, remove it and mark the old tag for
! 		 renaming to remove it out of the IL.  */
! 	      var_ann_t ann = var_ann (var);
! 	      tree tag = ann->type_mem_tag;
! 	      if (tag)
! 		{
! 		  bitmap_set_bit (vars_to_rename, var_ann (tag)->uid);
! 		  ann->type_mem_tag = NULL_TREE;
! 		}
! 	    }
  	}
      }
  
Index: tree-ssa-ccp.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssa-ccp.c,v
retrieving revision 2.26
diff -d -c -p -r2.26 tree-ssa-ccp.c
*** tree-ssa-ccp.c	23 Jul 2004 22:37:23 -0000	2.26
--- tree-ssa-ccp.c	28 Jul 2004 04:15:26 -0000
*************** struct tree_opt_pass pass_ccp = 
*** 245,251 ****
    NULL,					/* next */
    0,					/* static_pass_number */
    TV_TREE_CCP,				/* tv_id */
!   PROP_cfg | PROP_ssa,			/* properties_required */
    0,					/* properties_provided */
    0,					/* properties_destroyed */
    0,					/* todo_flags_start */
--- 245,251 ----
    NULL,					/* next */
    0,					/* static_pass_number */
    TV_TREE_CCP,				/* tv_id */
!   PROP_cfg | PROP_ssa | PROP_alias,	/* properties_required */
    0,					/* properties_provided */
    0,					/* properties_destroyed */
    0,					/* todo_flags_start */
*************** struct tree_opt_pass pass_fold_builtins 
*** 2704,2710 ****
    NULL,					/* next */
    0,					/* static_pass_number */
    0,					/* tv_id */
!   PROP_cfg | PROP_ssa,			/* properties_required */
    0,					/* properties_provided */
    0,					/* properties_destroyed */
    0,					/* todo_flags_start */
--- 2704,2710 ----
    NULL,					/* next */
    0,					/* static_pass_number */
    0,					/* tv_id */
!   PROP_cfg | PROP_ssa | PROP_alias,	/* properties_required */
    0,					/* properties_provided */
    0,					/* properties_destroyed */
    0,					/* todo_flags_start */
Index: tree-ssa-copyrename.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssa-copyrename.c,v
retrieving revision 2.7
diff -d -c -p -r2.7 tree-ssa-copyrename.c
*** tree-ssa-copyrename.c	24 Jul 2004 01:05:44 -0000	2.7
--- tree-ssa-copyrename.c	28 Jul 2004 04:15:26 -0000
*************** struct tree_opt_pass pass_rename_ssa_cop
*** 391,397 ****
    NULL,					/* next */
    0,					/* static_pass_number */
    TV_TREE_COPY_RENAME,			/* tv_id */
!   PROP_cfg | PROP_ssa,			/* properties_required */
    0,					/* properties_provided */
    0,					/* properties_destroyed */
    0,					/* todo_flags_start */ 
--- 391,397 ----
    NULL,					/* next */
    0,					/* static_pass_number */
    TV_TREE_COPY_RENAME,			/* tv_id */
!   PROP_cfg | PROP_ssa | PROP_alias,	/* properties_required */
    0,					/* properties_provided */
    0,					/* properties_destroyed */
    0,					/* todo_flags_start */ 
Index: tree-ssa-dce.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssa-dce.c,v
retrieving revision 2.10
diff -d -c -p -r2.10 tree-ssa-dce.c
*** tree-ssa-dce.c	22 Jul 2004 16:39:48 -0000	2.10
--- tree-ssa-dce.c	28 Jul 2004 04:15:27 -0000
*************** struct tree_opt_pass pass_dce =
*** 908,914 ****
    NULL,					/* next */
    0,					/* static_pass_number */
    TV_TREE_DCE,				/* tv_id */
!   PROP_cfg | PROP_ssa,			/* properties_required */
    0,					/* properties_provided */
    0,					/* properties_destroyed */
    0,					/* todo_flags_start */
--- 908,914 ----
    NULL,					/* next */
    0,					/* static_pass_number */
    TV_TREE_DCE,				/* tv_id */
!   PROP_cfg | PROP_ssa | PROP_alias,	/* properties_required */
    0,					/* properties_provided */
    0,					/* properties_destroyed */
    0,					/* todo_flags_start */
*************** struct tree_opt_pass pass_cd_dce =
*** 924,930 ****
    NULL,					/* next */
    0,					/* static_pass_number */
    TV_TREE_CD_DCE,			/* tv_id */
!   PROP_cfg | PROP_ssa,			/* properties_required */
    0,					/* properties_provided */
    0,					/* properties_destroyed */
    0,					/* todo_flags_start */
--- 924,930 ----
    NULL,					/* next */
    0,					/* static_pass_number */
    TV_TREE_CD_DCE,			/* tv_id */
!   PROP_cfg | PROP_ssa | PROP_alias,	/* properties_required */
    0,					/* properties_provided */
    0,					/* properties_destroyed */
    0,					/* todo_flags_start */
Index: tree-ssa-dom.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssa-dom.c,v
retrieving revision 2.27
diff -d -c -p -r2.27 tree-ssa-dom.c
*** tree-ssa-dom.c	25 Jul 2004 23:26:59 -0000	2.27
--- tree-ssa-dom.c	28 Jul 2004 04:15:27 -0000
*************** struct tree_opt_pass pass_dominator = 
*** 692,698 ****
    NULL,					/* next */
    0,					/* static_pass_number */
    TV_TREE_SSA_DOMINATOR_OPTS,		/* tv_id */
!   PROP_cfg | PROP_ssa,			/* properties_required */
    0,					/* properties_provided */
    0,					/* properties_destroyed */
    0,					/* todo_flags_start */
--- 692,698 ----
    NULL,					/* next */
    0,					/* static_pass_number */
    TV_TREE_SSA_DOMINATOR_OPTS,		/* tv_id */
!   PROP_cfg | PROP_ssa | PROP_alias,	/* properties_required */
    0,					/* properties_provided */
    0,					/* properties_destroyed */
    0,					/* todo_flags_start */
Index: tree-ssa-dse.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssa-dse.c,v
retrieving revision 2.6
diff -d -c -p -r2.6 tree-ssa-dse.c
*** tree-ssa-dse.c	8 Jul 2004 16:16:41 -0000	2.6
--- tree-ssa-dse.c	28 Jul 2004 04:15:27 -0000
*************** struct tree_opt_pass pass_dse = {
*** 437,443 ****
    NULL,				/* next */
    0,				/* static_pass_number */
    TV_TREE_DSE,			/* tv_id */
!   PROP_cfg | PROP_ssa,		/* properties_required */
    0,				/* properties_provided */
    0,				/* properties_destroyed */
    0,				/* todo_flags_start */
--- 437,444 ----
    NULL,				/* next */
    0,				/* static_pass_number */
    TV_TREE_DSE,			/* tv_id */
!   PROP_cfg | PROP_ssa
!     | PROP_alias,		/* properties_required */
    0,				/* properties_provided */
    0,				/* properties_destroyed */
    0,				/* todo_flags_start */
Index: tree-ssa-forwprop.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssa-forwprop.c,v
retrieving revision 2.3
diff -d -c -p -r2.3 tree-ssa-forwprop.c
*** tree-ssa-forwprop.c	25 Jul 2004 23:26:59 -0000	2.3
--- tree-ssa-forwprop.c	28 Jul 2004 04:15:27 -0000
*************** struct tree_opt_pass pass_forwprop = {
*** 517,523 ****
    NULL,				/* next */
    0,				/* static_pass_number */
    TV_TREE_FORWPROP,		/* tv_id */
!   PROP_cfg | PROP_ssa,		/* properties_required */
    0,				/* properties_provided */
    0,				/* properties_destroyed */
    0,				/* todo_flags_start */
--- 517,524 ----
    NULL,				/* next */
    0,				/* static_pass_number */
    TV_TREE_FORWPROP,		/* tv_id */
!   PROP_cfg | PROP_ssa
!     | PROP_alias,		/* properties_required */
    0,				/* properties_provided */
    0,				/* properties_destroyed */
    0,				/* todo_flags_start */
Index: tree-ssa-loop-ch.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssa-loop-ch.c,v
retrieving revision 2.1
diff -d -c -p -r2.1 tree-ssa-loop-ch.c
*** tree-ssa-loop-ch.c	30 Jun 2004 21:11:28 -0000	2.1
--- tree-ssa-loop-ch.c	28 Jul 2004 04:15:27 -0000
*************** struct tree_opt_pass pass_ch = 
*** 340,346 ****
    NULL,					/* next */
    0,					/* static_pass_number */
    TV_TREE_CH,				/* tv_id */
!   PROP_cfg | PROP_ssa,			/* properties_required */
    0,					/* properties_provided */
    0,					/* properties_destroyed */
    0,					/* todo_flags_start */
--- 340,346 ----
    NULL,					/* next */
    0,					/* static_pass_number */
    TV_TREE_CH,				/* tv_id */
!   PROP_cfg | PROP_ssa | PROP_alias,	/* properties_required */
    0,					/* properties_provided */
    0,					/* properties_destroyed */
    0,					/* todo_flags_start */
Index: tree-ssa-operands.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssa-operands.c,v
retrieving revision 2.25
diff -d -c -p -r2.25 tree-ssa-operands.c
*** tree-ssa-operands.c	25 Jul 2004 14:43:51 -0000	2.25
--- tree-ssa-operands.c	28 Jul 2004 04:15:29 -0000
*************** get_asm_expr_operands (tree stmt, vopera
*** 1137,1149 ****
  	      add_stmt_operand (&var, stmt, opf_is_def, prev_vops);
  	    });
  
- 	/* If we don't have call-clobbered nor addressable vars and we
- 	   still have not computed aliasing information, just mark the
- 	   statement as having volatile operands.  If the alias pass
- 	   finds some, we will add them at that point.  */
- 	if (!aliases_computed_p)
- 	  stmt_ann (stmt)->has_volatile_ops = true;
- 
  	break;
        }
  }
--- 1137,1142 ----
*************** get_indirect_ref_operands (tree stmt, tr
*** 1159,1211 ****
  
    if (SSA_VAR_P (ptr))
      {
!       if (!aliases_computed_p)
  	{
! 	  /* If the pointer does not have a memory tag and aliases have not
! 	     been computed yet, mark the statement as having volatile
! 	     operands to prevent DOM from entering it in equivalence tables
! 	     and DCE from killing it.  */
! 	  stmt_ann (stmt)->has_volatile_ops = true;
  	}
        else
  	{
! 	  struct ptr_info_def *pi = NULL;
  
! 	  /* If we have computed aliasing already, check if PTR has
! 	     flow-sensitive points-to information.  */
! 	  if (TREE_CODE (ptr) == SSA_NAME
! 	      && (pi = SSA_NAME_PTR_INFO (ptr)) != NULL
! 	      && pi->name_mem_tag)
  	    {
! 	      /* PTR has its own memory tag.  Use it.  */
! 	      add_stmt_operand (&pi->name_mem_tag, stmt, flags, prev_vops);
  	    }
- 	  else
- 	    {
- 	      /* If PTR is not an SSA_NAME or it doesn't have a name
- 		 tag, use its type memory tag.  */
- 	      var_ann_t ann;
  
! 	      /* If we are emitting debugging dumps, display a warning if
! 		 PTR is an SSA_NAME with no flow-sensitive alias
! 		 information.  That means that we may need to compute
! 		 aliasing again.  */
! 	      if (dump_file
! 		  && TREE_CODE (ptr) == SSA_NAME
! 		  && pi == NULL)
! 		{
! 		  fprintf (dump_file,
! 			   "NOTE: no flow-sensitive alias info for ");
! 		  print_generic_expr (dump_file, ptr, dump_flags);
! 		  fprintf (dump_file, " in ");
! 		  print_generic_stmt (dump_file, stmt, dump_flags);
! 		}
! 
! 	      if (TREE_CODE (ptr) == SSA_NAME)
! 		ptr = SSA_NAME_VAR (ptr);
! 	      ann = var_ann (ptr);
! 	      add_stmt_operand (&ann->type_mem_tag, stmt, flags, prev_vops);
! 	    }
  	}
      }
  
--- 1152,1193 ----
  
    if (SSA_VAR_P (ptr))
      {
!       struct ptr_info_def *pi = NULL;
! 
!       /* If PTR has flow-sensitive points-to information, use it.  */
!       if (TREE_CODE (ptr) == SSA_NAME
! 	  && (pi = SSA_NAME_PTR_INFO (ptr)) != NULL
! 	  && pi->name_mem_tag)
  	{
! 	  /* PTR has its own memory tag.  Use it.  */
! 	  add_stmt_operand (&pi->name_mem_tag, stmt, flags, prev_vops);
  	}
        else
  	{
! 	  /* If PTR is not an SSA_NAME or it doesn't have a name
! 	     tag, use its type memory tag.  */
! 	  var_ann_t ann;
  
! 	  /* If we are emitting debugging dumps, display a warning if
! 	     PTR is an SSA_NAME with no flow-sensitive alias
! 	     information.  That means that we may need to compute
! 	     aliasing again.  */
! 	  if (dump_file
! 	      && TREE_CODE (ptr) == SSA_NAME
! 	      && pi == NULL)
  	    {
! 	      fprintf (dump_file,
! 		  "NOTE: no flow-sensitive alias info for ");
! 	      print_generic_expr (dump_file, ptr, dump_flags);
! 	      fprintf (dump_file, " in ");
! 	      print_generic_stmt (dump_file, stmt, dump_flags);
  	    }
  
! 	  if (TREE_CODE (ptr) == SSA_NAME)
! 	    ptr = SSA_NAME_VAR (ptr);
! 	  ann = var_ann (ptr);
! 	  if (ann->type_mem_tag)
! 	    add_stmt_operand (&ann->type_mem_tag, stmt, flags, prev_vops);
  	}
      }
  
*************** get_call_expr_operands (tree stmt, tree 
*** 1272,1279 ****
        else if (!(call_flags & (ECF_CONST | ECF_NORETURN)))
  	add_call_read_ops (stmt, prev_vops);
      }
-   else if (!aliases_computed_p)
-     stmt_ann (stmt)->has_volatile_ops = true;
  }
  
  
--- 1254,1259 ----
*************** add_stmt_operand (tree *var_p, tree stmt
*** 1348,1360 ****
  
        aliases = v_ann->may_aliases;
  
-       /* If alias information hasn't been computed yet, then
- 	 addressable variables will not be an alias tag nor will they
- 	 have aliases.  In this case, mark the statement as having
- 	 volatile operands.  */
-       if (!aliases_computed_p && may_be_aliased (var))
- 	s_ann->has_volatile_ops = true;
- 
        if (aliases == NULL)
  	{
  	  /* The variable is not aliased or it is an alias tag.  */
--- 1328,1333 ----
Index: tree-ssa-phiopt.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssa-phiopt.c,v
retrieving revision 2.9
diff -d -c -p -r2.9 tree-ssa-phiopt.c
*** tree-ssa-phiopt.c	17 Jul 2004 18:08:10 -0000	2.9
--- tree-ssa-phiopt.c	28 Jul 2004 04:15:29 -0000
*************** struct tree_opt_pass pass_phiopt =
*** 669,675 ****
    NULL,					/* next */
    0,					/* static_pass_number */
    TV_TREE_PHIOPT,			/* tv_id */
!   PROP_cfg | PROP_ssa,			/* properties_required */
    0,					/* properties_provided */
    0,					/* properties_destroyed */
    0,					/* todo_flags_start */
--- 669,675 ----
    NULL,					/* next */
    0,					/* static_pass_number */
    TV_TREE_PHIOPT,			/* tv_id */
!   PROP_cfg | PROP_ssa | PROP_alias,	/* properties_required */
    0,					/* properties_provided */
    0,					/* properties_destroyed */
    0,					/* todo_flags_start */
Index: tree-ssa-pre.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssa-pre.c,v
retrieving revision 2.28
diff -d -c -p -r2.28 tree-ssa-pre.c
*** tree-ssa-pre.c	22 Jul 2004 16:39:48 -0000	2.28
--- tree-ssa-pre.c	28 Jul 2004 04:15:29 -0000
*************** struct tree_opt_pass pass_pre =
*** 2076,2082 ****
    NULL,					/* next */
    0,					/* static_pass_number */
    TV_TREE_PRE,				/* tv_id */
!   PROP_no_crit_edges | PROP_cfg | PROP_ssa,/* properties_required */
    0,					/* properties_provided */
    0,					/* properties_destroyed */
    0,					/* todo_flags_start */
--- 2076,2083 ----
    NULL,					/* next */
    0,					/* static_pass_number */
    TV_TREE_PRE,				/* tv_id */
!   PROP_no_crit_edges | PROP_cfg
!     | PROP_ssa | PROP_alias,		/* properties_required */
    0,					/* properties_provided */
    0,					/* properties_destroyed */
    0,					/* todo_flags_start */
*************** struct tree_opt_pass pass_fre =
*** 2107,2113 ****
    NULL,					/* next */
    0,					/* static_pass_number */
    TV_TREE_FRE,				/* tv_id */
!   PROP_no_crit_edges | PROP_cfg | PROP_ssa,/* properties_required */
    0,					/* properties_provided */
    0,					/* properties_destroyed */
    0,					/* todo_flags_start */
--- 2108,2114 ----
    NULL,					/* next */
    0,					/* static_pass_number */
    TV_TREE_FRE,				/* tv_id */
!   PROP_cfg | PROP_ssa | PROP_alias,	/* properties_required */
    0,					/* properties_provided */
    0,					/* properties_destroyed */
    0,					/* todo_flags_start */
Index: tree-ssa.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssa.c,v
retrieving revision 2.23
diff -d -c -p -r2.23 tree-ssa.c
*** tree-ssa.c	24 Jul 2004 01:05:44 -0000	2.23
--- tree-ssa.c	28 Jul 2004 04:15:29 -0000
*************** err:
*** 505,515 ****
  static void
  verify_alias_info (void)
  {
!   if (aliases_computed_p)
!     {
!       verify_flow_sensitive_alias_info ();
!       verify_flow_insensitive_alias_info ();
!     }
  }
  
  
--- 505,512 ----
  static void
  verify_alias_info (void)
  {
!   verify_flow_sensitive_alias_info ();
!   verify_flow_insensitive_alias_info ();
  }
  
  
*************** init_tree_ssa (void)
*** 677,683 ****
    init_ssanames ();
    init_phinodes ();
    global_var = NULL_TREE;
-   aliases_computed_p = false;
  }
  
  
--- 674,679 ----
*************** delete_tree_ssa (void)
*** 710,716 ****
    global_var = NULL_TREE;
    BITMAP_XFREE (call_clobbered_vars);
    call_clobbered_vars = NULL;
-   aliases_computed_p = false;
    BITMAP_XFREE (addressable_vars);
    addressable_vars = NULL;
  }
--- 706,711 ----
*************** struct tree_opt_pass pass_redundant_phi 
*** 1211,1217 ****
    NULL,					/* next */
    0,					/* static_pass_number */
    0,					/* tv_id */
!   PROP_cfg | PROP_ssa,			/* properties_required */
    0,					/* properties_provided */
    0,					/* properties_destroyed */
    0,					/* todo_flags_start */
--- 1206,1212 ----
    NULL,					/* next */
    0,					/* static_pass_number */
    0,					/* tv_id */
!   PROP_cfg | PROP_ssa | PROP_alias,	/* properties_required */
    0,					/* properties_provided */
    0,					/* properties_destroyed */
    0,					/* todo_flags_start */
Index: tree-tailcall.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-tailcall.c,v
retrieving revision 2.18
diff -d -c -p -r2.18 tree-tailcall.c
*** tree-tailcall.c	23 Jul 2004 22:37:23 -0000	2.18
--- tree-tailcall.c	28 Jul 2004 04:15:29 -0000
*************** struct tree_opt_pass pass_tail_recursion
*** 937,943 ****
    NULL,					/* next */
    0,					/* static_pass_number */
    0,					/* tv_id */
!   PROP_cfg | PROP_ssa,			/* properties_required */
    0,					/* properties_provided */
    0,					/* properties_destroyed */
    0,					/* todo_flags_start */
--- 937,943 ----
    NULL,					/* next */
    0,					/* static_pass_number */
    0,					/* tv_id */
!   PROP_cfg | PROP_ssa | PROP_alias,	/* properties_required */
    0,					/* properties_provided */
    0,					/* properties_destroyed */
    0,					/* todo_flags_start */
*************** struct tree_opt_pass pass_tail_calls = 
*** 953,959 ****
    NULL,					/* next */
    0,					/* static_pass_number */
    0,					/* tv_id */
!   PROP_cfg | PROP_ssa,			/* properties_required */
    0,					/* properties_provided */
    0,					/* properties_destroyed */
    0,					/* todo_flags_start */
--- 953,959 ----
    NULL,					/* next */
    0,					/* static_pass_number */
    0,					/* tv_id */
!   PROP_cfg | PROP_ssa | PROP_alias,	/* properties_required */
    0,					/* properties_provided */
    0,					/* properties_destroyed */
    0,					/* todo_flags_start */
Index: testsuite/gcc.dg/tree-ssa/20030714-2.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/tree-ssa/20030714-2.c,v
retrieving revision 1.2
diff -d -c -p -r1.2 20030714-2.c
*** testsuite/gcc.dg/tree-ssa/20030714-2.c	13 May 2004 06:40:51 -0000	1.2
--- testsuite/gcc.dg/tree-ssa/20030714-2.c	28 Jul 2004 04:15:31 -0000
*************** get_alias_set (t)
*** 32,39 ****
      }
  }
  
! /* There should be exactly four IF conditionals if we thread jumps
     properly.  */
! /* { dg-final { scan-tree-dump-times "if " 4 "dom3"} } */
   
  
--- 32,39 ----
      }
  }
  
! /* There should be exactly three IF conditionals if we thread jumps
     properly.  */
! /* { dg-final { scan-tree-dump-times "if " 3 "dom3"} } */
   
  
Index: testsuite/gcc.dg/tree-ssa/20031022-1.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/tree-ssa/20031022-1.c,v
retrieving revision 1.2
diff -d -c -p -r1.2 20031022-1.c
*** testsuite/gcc.dg/tree-ssa/20031022-1.c	13 May 2004 06:40:51 -0000	1.2
--- testsuite/gcc.dg/tree-ssa/20031022-1.c	28 Jul 2004 04:15:31 -0000
*************** blah (int arf)
*** 23,27 ****
    foo (e);
  }
  
! /* There should be two loads from entry_exit_blocks[1].pred.  */
  /* { dg-final { scan-tree-dump-times "entry_exit_blocks.1..pred" 2 "dom1"} } */
--- 23,27 ----
    foo (e);
  }
  
! /* There should be one load from entry_exit_blocks[1].pred.  */
  /* { dg-final { scan-tree-dump-times "entry_exit_blocks.1..pred" 2 "dom1"} } */
Index: testsuite/gcc.dg/tree-ssa/ssa-dom-cse-1.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-cse-1.c,v
retrieving revision 1.2
diff -d -c -p -r1.2 ssa-dom-cse-1.c
*** testsuite/gcc.dg/tree-ssa/ssa-dom-cse-1.c	13 May 2004 06:40:52 -0000	1.2
--- testsuite/gcc.dg/tree-ssa/ssa-dom-cse-1.c	28 Jul 2004 04:15:31 -0000
***************
*** 1,5 ****
  /* { dg-do compile } */ 
! /* { dg-options "-O2 -fdump-tree-dom2-details" } */
  int t(int a) __attribute__ ((const));
  void q (void);
  void
--- 1,5 ----
  /* { dg-do compile } */ 
! /* { dg-options "-O2 -fdump-tree-dom1-details" } */
  int t(int a) __attribute__ ((const));
  void q (void);
  void
*************** threading(int a,int b)
*** 11,16 ****
  	    q();
  	}
  }
! /* We should thread the jump twice and eliminate it.  Test this in
!    DOM2, after aliases have been computed.  */
! /* { dg-final { scan-tree-dump-times "Replaced.* t " 1 "dom2"} } */
--- 11,15 ----
  	    q();
  	}
  }
! /* We should thread the jump twice and eliminate it.  */
! /* { dg-final { scan-tree-dump-times "Replaced.* t " 1 "dom1"} } */



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