]> gcc.gnu.org Git - gcc.git/commitdiff
gimplify.c (is_gimple_addr_expr_arg_or_indirect): Remove.
authorRichard Henderson <rth@redhat.com>
Wed, 28 Jul 2004 01:17:00 +0000 (18:17 -0700)
committerRichard Henderson <rth@gcc.gnu.org>
Wed, 28 Jul 2004 01:17:00 +0000 (18:17 -0700)
        * gimplify.c (is_gimple_addr_expr_arg_or_indirect): Remove.
        (gimplify_modify_expr, gimplify_addr_expr, gimplify_expr): Use
        is_gimple_addressable.
        * tree-gimple.c (is_gimple_addressable): Rename from
        is_gimple_addr_expr_arg; accept INDIRECT_REF.
        (is_gimple_lvalue): Don't test INDIRECT_REF directly.
        * tree-gimple.h, tree-sra.c, tree-ssa-loop-im.c: Update for
        rename to is_gimple_addressable.

From-SVN: r85243

gcc/ChangeLog
gcc/gimplify.c
gcc/tree-gimple.c
gcc/tree-gimple.h
gcc/tree-sra.c
gcc/tree-ssa-loop-im.c

index e76b32b1670c0fca754fd0b756c7c125810d1387..f19695ff364fd6c44de6670f177f89c93d81f298 100644 (file)
@@ -1,3 +1,14 @@
+2004-07-27  Richard Henderson  <rth@redhat.com>
+
+       * gimplify.c (is_gimple_addr_expr_arg_or_indirect): Remove.
+       (gimplify_modify_expr, gimplify_addr_expr, gimplify_expr): Use
+       is_gimple_addressable.
+       * tree-gimple.c (is_gimple_addressable): Rename from
+       is_gimple_addr_expr_arg; accept INDIRECT_REF.
+       (is_gimple_lvalue): Don't test INDIRECT_REF directly.
+       * tree-gimple.h, tree-sra.c, tree-ssa-loop-im.c: Update for
+       rename to is_gimple_addressable.
+
 2004-07-28  Alan Modra  <amodra@bigpond.net.au>
 
        * config/rs6000/rs6000.c (function_arg_padding): Pad SFmode upwards.
index 079622b78d87a3d0c64994544c8fa1712718518f..fc260c8ce4deef8614a8c26448ca2fed4c3e2c6f 100644 (file)
@@ -2709,15 +2709,6 @@ gimplify_modify_expr_rhs (tree *expr_p, tree *from_p, tree *to_p, tree *pre_p,
   return ret;
 }
 
-/* Return true if T is either a valid GIMPLE operand or is an
-   INDIRECT_REF (the latter is valid since we'll strip it off).  */
-
-static bool
-is_gimple_addr_expr_arg_or_indirect (tree t)
-{
-  return (TREE_CODE (t) == INDIRECT_REF || is_gimple_addr_expr_arg (t));
-}
-
 /* Gimplify the MODIFY_EXPR node pointed by EXPR_P.
 
       modify_expr
@@ -2788,7 +2779,7 @@ gimplify_modify_expr (tree *expr_p, tree *pre_p, tree *post_p, bool want_value)
 
       if (TREE_CODE (from) == CONSTRUCTOR)
        return gimplify_modify_expr_to_memset (expr_p, size, want_value);
-      if (is_gimple_addr_expr_arg (from))
+      if (is_gimple_addressable (from))
        {
          *from_p = from;
          return gimplify_modify_expr_to_memcpy (expr_p, size, want_value);
@@ -3027,7 +3018,7 @@ gimplify_addr_expr (tree *expr_p, tree *pre_p, tree *post_p)
       /* We use fb_either here because the C frontend sometimes takes
         the address of a call that returns a struct.  */
       ret = gimplify_expr (&TREE_OPERAND (expr, 0), pre_p, post_p,
-                          is_gimple_addr_expr_arg_or_indirect, fb_either);
+                          is_gimple_addressable, fb_either);
       if (ret != GS_ERROR)
        {
          /* The above may have made an INDIRECT ref (e.g, Ada's NULL_EXPR),
@@ -3930,7 +3921,7 @@ gimplify_expr (tree *expr_p, tree *pre_p, tree *post_p,
      postqueue; we need to copy the value out first, which means an
      rvalue.  */
   if ((fallback & fb_lvalue) && !internal_post
-      && is_gimple_addr_expr_arg (*expr_p))
+      && is_gimple_addressable (*expr_p))
     {
       /* An lvalue will do.  Take the address of the expression, store it
         in a temporary, and replace the expression with an INDIRECT_REF of
index 3d2fff897ed8dd1bd4edda17c70673e251dd78d4..4f26a084fc03f087f8a5b86ccc9aa27d92eab3dc 100644 (file)
@@ -118,16 +118,17 @@ Boston, MA 02111-1307, USA.  */
    addr-expr-arg: ID
                | compref
 
-   with-size-arg: addr-expr-arg
+   addressable : addr-expr-arg
                | indirectref
+
+   with-size-arg: addressable
                | call-stmt
 
    indirectref : INDIRECT_REF
                        op0 -> val
 
-   lhs         : addr-expr-arg
+   lhs         : addressable
                | bitfieldref
-               | indirectref
                | WITH_SIZE_EXPR
                        op0 -> with-size-arg
                        op1 -> val
@@ -300,8 +301,7 @@ is_gimple_constructor_elt (tree t)
 bool
 is_gimple_lvalue (tree t)
 {
-  return (is_gimple_addr_expr_arg (t)
-         || TREE_CODE (t) == INDIRECT_REF
+  return (is_gimple_addressable (t)
          || TREE_CODE (t) == WITH_SIZE_EXPR
          /* These are complex lvalues, but don't have addresses, so they
             go here.  */
@@ -317,13 +317,15 @@ is_gimple_condexpr (tree t)
          || TREE_CODE_CLASS (TREE_CODE (t)) == '<');
 }
 
-/*  Return true if T is a valid operand for ADDR_EXPR.  */
+/*  Return true if T is something whose address can be taken.  */
 
 bool
-is_gimple_addr_expr_arg (tree t)
+is_gimple_addressable (tree t)
 {
   return (is_gimple_id (t) || handled_component_p (t)
-         || TREE_CODE (t) == REALPART_EXPR || TREE_CODE (t) == IMAGPART_EXPR);
+         || TREE_CODE (t) == REALPART_EXPR
+         || TREE_CODE (t) == IMAGPART_EXPR
+         || TREE_CODE (t) == INDIRECT_REF);
 }
 
 /* Return true if T is function invariant.  Or rather a restricted
index 3a87503f76d25084d2a25e4a19be047eb2867770..0fb376694e43f5572626beda75f01b0e7996ec31 100644 (file)
@@ -55,8 +55,8 @@ extern bool is_gimple_tmp_reg (tree);
 extern bool is_gimple_variable (tree);
 /* Returns true iff T is a variable or an INDIRECT_REF (of a variable).  */
 extern bool is_gimple_min_lval (tree);
-/* Returns true iff T is an lvalue other than an INDIRECT_REF.  */
-extern bool is_gimple_addr_expr_arg (tree);
+/* Returns true iff T is something whose address can be taken.  */
+extern bool is_gimple_addressable (tree);
 /* Returns true iff T is any valid GIMPLE lvalue.  */
 extern bool is_gimple_lvalue (tree);
 
index 73866b4972a2f4fc2b9a633098d4abd40bc706fa..30d8e34d32b08f6e084b02b69d5106044311648b 100644 (file)
@@ -826,7 +826,7 @@ sra_walk_modify_expr (tree expr, block_stmt_iterator *bsi,
         The lvalue requirement prevents us from trying to directly scalarize
         the result of a function call.  Which would result in trying to call
         the function multiple times, and other evil things.  */
-      else if (!lhs_elt->is_scalar && is_gimple_addr_expr_arg (rhs))
+      else if (!lhs_elt->is_scalar && is_gimple_addressable (rhs))
        fns->ldst (lhs_elt, rhs, bsi, true);
        
       /* Otherwise we're being used in some context that requires the
index e7afc24cb786c400f0978f0e26bc84dce6150c61..d8c70a9489f4e460ec4ea12816c1713c71b16748 100644 (file)
@@ -350,7 +350,7 @@ stmt_cost (tree stmt)
   /* Hoisting memory references out should almost surely be a win.  */
   if (!is_gimple_variable (lhs))
     cost += 20;
-  if (is_gimple_addr_expr_arg (rhs) && !is_gimple_variable (rhs))
+  if (is_gimple_addressable (rhs) && !is_gimple_variable (rhs))
     cost += 20;
 
   switch (TREE_CODE (rhs))
This page took 0.091583 seconds and 5 git commands to generate.