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]

Re: [PATCH] Kill unused anyoffset traces




On Sun, 8 Jan 2006, Richard Guenther wrote:


This removes all traces of anyoffset handling that was removed before.

Bootstrapped and regtested on x86_64-unknown-linux-gnu, ok for
mainline?

This is fine, thanks.



Thanks, Richard.


2006-01-08 Richard Guenther <rguenther@suse.de>


	* tree-ssa-structalias.c (get_constraint_for): Remove
	anyoffset argument.
	(get_constraint_for_component_ref): Likewise.
	(do_deref): Likewise.
	(get_constraint_for): Likewise.
	(do_structure_copy): Likewise.
	(handle_ptr_arith): Likewise.
	(find_func_aliases): Likewise.  Remove unused need_anyoffset
	variable.

Index: tree-ssa-structalias.c
===================================================================
*** tree-ssa-structalias.c	(revision 109471)
--- tree-ssa-structalias.c	(working copy)
*************** struct constraint_expr
*** 393,399 ****
 typedef struct constraint_expr ce_s;
 DEF_VEC_O(ce_s);
 DEF_VEC_ALLOC_O(ce_s, heap);
! static void get_constraint_for (tree, VEC(ce_s, heap) **, bool *);
 static void do_deref (VEC (ce_s, heap) **);

 /* Our set constraints are made up of two constraint expressions, one
--- 393,399 ----
 typedef struct constraint_expr ce_s;
 DEF_VEC_O(ce_s);
 DEF_VEC_ALLOC_O(ce_s, heap);
! static void get_constraint_for (tree, VEC(ce_s, heap) **);
 static void do_deref (VEC (ce_s, heap) **);

 /* Our set constraints are made up of two constraint expressions, one
*************** offset_overlaps_with_access (const unsig
*** 2343,2350 ****
 /* Given a COMPONENT_REF T, return the constraint_expr for it.  */

 static void
! get_constraint_for_component_ref (tree t, VEC(ce_s, heap) **results,
! 				  bool *anyoffset)
 {
   tree orig_t = t;
   HOST_WIDE_INT bitsize = -1;
--- 2343,2349 ----
 /* Given a COMPONENT_REF T, return the constraint_expr for it.  */

 static void
! get_constraint_for_component_ref (tree t, VEC(ce_s, heap) **results)
 {
   tree orig_t = t;
   HOST_WIDE_INT bitsize = -1;
*************** get_constraint_for_component_ref (tree t
*** 2372,2378 ****
     }

   t = get_ref_base_and_extent (t, &bitpos, &bitsize, &bitmaxsize);
!   get_constraint_for (t, results, anyoffset);
   result = VEC_last (ce_s, *results);

   gcc_assert (beforelength + 1 == VEC_length (ce_s, *results));
--- 2371,2377 ----
     }

   t = get_ref_base_and_extent (t, &bitpos, &bitsize, &bitmaxsize);
!   get_constraint_for (t, results);
   result = VEC_last (ce_s, *results);

   gcc_assert (beforelength + 1 == VEC_length (ce_s, *results));
*************** get_constraint_for_component_ref (tree t
*** 2387,2398 ****
     {
       result->offset = bitpos;
     }
-   /* FIXME: Handle the DEREF case.  */
-   else if (anyoffset && result->type != DEREF)
-     {
-       result->offset = 0;
-       *anyoffset = true;
-     }
   else
     {
       result->var = anything_id;
--- 2386,2391 ----
*************** do_deref (VEC (ce_s, heap) **constraints
*** 2470,2476 ****
 /* Given a tree T, return the constraint expression for it.  */

 static void
! get_constraint_for (tree t, VEC (ce_s, heap) **results, bool *anyoffset)
 {
   struct constraint_expr temp;

--- 2463,2469 ----
 /* Given a tree T, return the constraint expression for it.  */

 static void
! get_constraint_for (tree t, VEC (ce_s, heap) **results)
 {
   struct constraint_expr temp;

*************** get_constraint_for (tree t, VEC (ce_s, h
*** 2512,2518 ****
 	      struct constraint_expr *c;
 	      unsigned int i;

! 	      get_constraint_for (TREE_OPERAND (t, 0), results, anyoffset);
 	      for (i = 0; VEC_iterate (ce_s, *results, i, c); i++)
 		{
 		  if (c->type == DEREF)
--- 2505,2511 ----
 	      struct constraint_expr *c;
 	      unsigned int i;

! 	      get_constraint_for (TREE_OPERAND (t, 0), results);
 	      for (i = 0; VEC_iterate (ce_s, *results, i, c); i++)
 		{
 		  if (c->type == DEREF)
*************** get_constraint_for (tree t, VEC (ce_s, h
*** 2569,2582 ****
 	  {
 	  case INDIRECT_REF:
 	    {
! 	      get_constraint_for (TREE_OPERAND (t, 0), results, anyoffset);
 	      do_deref (results);
 	      return;
 	    }
 	  case ARRAY_REF:
 	  case ARRAY_RANGE_REF:
 	  case COMPONENT_REF:
! 	    get_constraint_for_component_ref (t, results, anyoffset);
 	    return;
 	  default:
 	    {
--- 2562,2575 ----
 	  {
 	  case INDIRECT_REF:
 	    {
! 	      get_constraint_for (TREE_OPERAND (t, 0), results);
 	      do_deref (results);
 	      return;
 	    }
 	  case ARRAY_REF:
 	  case ARRAY_RANGE_REF:
 	  case COMPONENT_REF:
! 	    get_constraint_for_component_ref (t, results);
 	    return;
 	  default:
 	    {
*************** get_constraint_for (tree t, VEC (ce_s, h
*** 2603,2609 ****
 	      if (!(POINTER_TYPE_P (TREE_TYPE (t))
 		    && ! POINTER_TYPE_P (TREE_TYPE (op))))
 		{
! 		  get_constraint_for (op, results, anyoffset);
 		  return;
 		}

--- 2596,2602 ----
 	      if (!(POINTER_TYPE_P (TREE_TYPE (t))
 		    && ! POINTER_TYPE_P (TREE_TYPE (op))))
 		{
! 		  get_constraint_for (op, results);
 		  return;
 		}

*************** get_constraint_for (tree t, VEC (ce_s, h
*** 2625,2631 ****
 	  {
 	  case PHI_NODE:
 	    {
! 	      get_constraint_for (PHI_RESULT (t), results, anyoffset);
 	      return;
 	    }
 	    break;
--- 2618,2624 ----
 	  {
 	  case PHI_NODE:
 	    {
! 	      get_constraint_for (PHI_RESULT (t), results);
 	      return;
 	    }
 	    break;
*************** do_structure_copy (tree lhsop, tree rhso
*** 2823,2830 ****
   unsigned HOST_WIDE_INT lhssize;
   unsigned HOST_WIDE_INT rhssize;

!   get_constraint_for (lhsop, &lhsc, NULL);
!   get_constraint_for (rhsop, &rhsc, NULL);
   gcc_assert (VEC_length (ce_s, lhsc) == 1);
   gcc_assert (VEC_length (ce_s, rhsc) == 1);
   lhs = *(VEC_last (ce_s, lhsc));
--- 2816,2823 ----
   unsigned HOST_WIDE_INT lhssize;
   unsigned HOST_WIDE_INT rhssize;

!   get_constraint_for (lhsop, &lhsc);
!   get_constraint_for (rhsop, &rhsc);
   gcc_assert (VEC_length (ce_s, lhsc) == 1);
   gcc_assert (VEC_length (ce_s, rhsc) == 1);
   lhs = *(VEC_last (ce_s, lhsc));
*************** handle_ptr_arith (VEC (ce_s, heap) *lhsc
*** 3167,3173 ****
   op0 = TREE_OPERAND (expr, 0);
   op1 = TREE_OPERAND (expr, 1);

!   get_constraint_for (op0, &temp, NULL);
   if (POINTER_TYPE_P (TREE_TYPE (op0))
       && TREE_CODE (TREE_TYPE (TREE_TYPE (op0))) == RECORD_TYPE
       && TREE_CODE (op1) == INTEGER_CST)
--- 3160,3166 ----
   op0 = TREE_OPERAND (expr, 0);
   op1 = TREE_OPERAND (expr, 1);

!   get_constraint_for (op0, &temp);
   if (POINTER_TYPE_P (TREE_TYPE (op0))
       && TREE_CODE (TREE_TYPE (TREE_TYPE (op0))) == RECORD_TYPE
       && TREE_CODE (op1) == INTEGER_CST)
*************** find_func_aliases (tree origt)
*** 3231,3240 ****

 	  /* For a phi node, assign all the arguments to
 	     the result.  */
! 	  get_constraint_for (PHI_RESULT (t), &lhsc, NULL);
 	  for (i = 0; i < PHI_NUM_ARGS (t); i++)
 	    {
! 	      get_constraint_for (PHI_ARG_DEF (t, i), &rhsc, NULL);
 	      for (j = 0; VEC_iterate (ce_s, lhsc, j, c); j++)
 		{
 		  struct constraint_expr *c2;
--- 3224,3233 ----

 	  /* For a phi node, assign all the arguments to
 	     the result.  */
! 	  get_constraint_for (PHI_RESULT (t), &lhsc);
 	  for (i = 0; i < PHI_NUM_ARGS (t); i++)
 	    {
! 	      get_constraint_for (PHI_ARG_DEF (t, i), &rhsc);
 	      for (j = 0; VEC_iterate (ce_s, lhsc, j, c); j++)
 		{
 		  struct constraint_expr *c2;
*************** find_func_aliases (tree origt)
*** 3307,3313 ****
 	  struct constraint_expr lhs ;
 	  struct constraint_expr *rhsp;

! 	  get_constraint_for (arg, &rhsc, NULL);
 	  if (TREE_CODE (decl) != FUNCTION_DECL)
 	    {
 	      lhs.type = DEREF;
--- 3300,3306 ----
 	  struct constraint_expr lhs ;
 	  struct constraint_expr *rhsp;

! 	  get_constraint_for (arg, &rhsc);
 	  if (TREE_CODE (decl) != FUNCTION_DECL)
 	    {
 	      lhs.type = DEREF;
*************** find_func_aliases (tree origt)
*** 3335,3341 ****
 	  struct constraint_expr *lhsp;
 	  unsigned int j = 0;

! 	  get_constraint_for (lhsop, &lhsc, NULL);
 	  if (TREE_CODE (decl) != FUNCTION_DECL)
 	    {
 	      rhs.type = DEREF;
--- 3328,3334 ----
 	  struct constraint_expr *lhsp;
 	  unsigned int j = 0;

! 	  get_constraint_for (lhsop, &lhsc);
 	  if (TREE_CODE (decl) != FUNCTION_DECL)
 	    {
 	      rhs.type = DEREF;
*************** find_func_aliases (tree origt)
*** 3372,3378 ****
 	      || AGGREGATE_TYPE_P (TREE_TYPE (lhsop))
 	      || TREE_CODE (rhsop) == CALL_EXPR)
 	    {
! 	      get_constraint_for (lhsop, &lhsc, NULL);
 	      switch (TREE_CODE_CLASS (TREE_CODE (rhsop)))
 		{
 		  /* RHS that consist of unary operations,
--- 3365,3371 ----
 	      || AGGREGATE_TYPE_P (TREE_TYPE (lhsop))
 	      || TREE_CODE (rhsop) == CALL_EXPR)
 	    {
! 	      get_constraint_for (lhsop, &lhsc);
 	      switch (TREE_CODE_CLASS (TREE_CODE (rhsop)))
 		{
 		  /* RHS that consist of unary operations,
*************** find_func_aliases (tree origt)
*** 3386,3392 ****
 		  case tcc_unary:
 		      {
 			unsigned int j;
- 			bool need_anyoffset = false;
 			tree strippedrhs = rhsop;
 			tree rhstype;

--- 3379,3384 ----
*************** find_func_aliases (tree origt)
*** 3395,3401 ****
 			STRIP_NOPS (strippedrhs);
 			rhstype = TREE_TYPE (strippedrhs);

! 			get_constraint_for (rhsop, &rhsc, &need_anyoffset);
 			if (TREE_CODE (strippedrhs) == ADDR_EXPR
 			    && AGGREGATE_TYPE_P (TREE_TYPE (rhstype)))
 			  {
--- 3387,3393 ----
 			STRIP_NOPS (strippedrhs);
 			rhstype = TREE_TYPE (strippedrhs);

! 			get_constraint_for (rhsop, &rhsc);
 			if (TREE_CODE (strippedrhs) == ADDR_EXPR
 			    && AGGREGATE_TYPE_P (TREE_TYPE (rhstype)))
 			  {
*************** find_func_aliases (tree origt)
*** 3449,3455 ****
 			unsigned int j;

 			gcc_assert (VEC_length (ce_s, rhsc) == 0);
! 			get_constraint_for (op, &rhsc, NULL);
 			for (j = 0; VEC_iterate (ce_s, lhsc, j, c); j++)
 			  {
 			    struct constraint_expr *c2;
--- 3441,3447 ----
 			unsigned int j;

 			gcc_assert (VEC_length (ce_s, rhsc) == 0);
! 			get_constraint_for (op, &rhsc);
 			for (j = 0; VEC_iterate (ce_s, lhsc, j, c); j++)
 			  {
 			    struct constraint_expr *c2;




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