[PATCH] Remove (duplicate) build_addr_strip_iref

Richard Guenther rguenth@tat.physik.uni-tuebingen.de
Thu May 19 10:12:00 GMT 2005


This removes build_addr_strip_iref in favor of build_fold_addr_expr.

Bootstrapped and regtested on x86_64-unknown-linux-gnu.

Ok for mainline?

Richard.


2005-05-19  Richard Guenther  <rguenth@gcc.gnu.org>

	* tree-ssa-loop-ivopts.c (build_addr_strip_iref): Remove.
	(find_interesting_uses_address): Use build_fold_addr_expr instead.
	(strip_offset_1): Likewise.
	(tree_to_aff_combination): Likewise.


Index: tree-ssa-loop-ivopts.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssa-loop-ivopts.c,v
retrieving revision 2.70
diff -c -3 -p -r2.70 tree-ssa-loop-ivopts.c
*** tree-ssa-loop-ivopts.c	17 May 2005 20:02:56 -0000	2.70
--- tree-ssa-loop-ivopts.c	19 May 2005 09:15:38 -0000
*************** may_be_unaligned_p (tree ref)
*** 1512,1536 ****
    return false;
  }

- /* Builds ADDR_EXPR of object OBJ.  If OBJ is an INDIRECT_REF, the indirect_ref
-    is stripped instead.  */
-
- static tree
- build_addr_strip_iref (tree obj)
- {
-   tree type;
-
-   if (TREE_CODE (obj) == INDIRECT_REF)
-     {
-       type = build_pointer_type (TREE_TYPE (obj));
-       obj = fold_convert (type, TREE_OPERAND (obj, 0));
-     }
-   else
-     obj = build_addr (obj);
-
-   return obj;
- }
-
  /* Finds addresses in *OP_P inside STMT.  */

  static void
--- 1517,1522 ----
*************** find_interesting_uses_address (struct iv
*** 1565,1571 ****
    gcc_assert (TREE_CODE (base) != ALIGN_INDIRECT_REF);
    gcc_assert (TREE_CODE (base) != MISALIGNED_INDIRECT_REF);

!   base = build_addr_strip_iref (base);

    civ = alloc_iv (base, step);
    record_use (data, op_p, civ, stmt, USE_ADDRESS);
--- 1551,1557 ----
    gcc_assert (TREE_CODE (base) != ALIGN_INDIRECT_REF);
    gcc_assert (TREE_CODE (base) != MISALIGNED_INDIRECT_REF);

!   base = build_fold_addr_expr (base);

    civ = alloc_iv (base, step);
    record_use (data, op_p, civ, stmt, USE_ADDRESS);
*************** strip_offset_1 (tree expr, bool inside_a
*** 1858,1864 ****
        if (op0 == TREE_OPERAND (expr, 0))
  	return orig_expr;

!       expr = build_addr_strip_iref (op0);
        return fold_convert (orig_type, expr);

      case INDIRECT_REF:
--- 1847,1853 ----
        if (op0 == TREE_OPERAND (expr, 0))
  	return orig_expr;

!       expr = build_fold_addr_expr (op0);
        return fold_convert (orig_type, expr);

      case INDIRECT_REF:
*************** tree_to_aff_combination (tree expr, tree
*** 2846,2852 ****
        if (bitpos % BITS_PER_UNIT != 0)
  	break;
        aff_combination_const (comb, type, bitpos / BITS_PER_UNIT);
!       core = build_addr_strip_iref (core);
        if (TREE_CODE (core) == ADDR_EXPR)
  	aff_combination_add_elt (comb, core, 1);
        else
--- 2835,2841 ----
        if (bitpos % BITS_PER_UNIT != 0)
  	break;
        aff_combination_const (comb, type, bitpos / BITS_PER_UNIT);
!       core = build_fold_addr_expr (core);
        if (TREE_CODE (core) == ADDR_EXPR)
  	aff_combination_add_elt (comb, core, 1);
        else



More information about the Gcc-patches mailing list