OSDN Git Service

* varasm.c (assemble_variable): Fix format specifier thinko.
[pf3gnuchains/gcc-fork.git] / gcc / tree-ssa-operands.c
index 83ec21b..f090024 100644 (file)
@@ -15,8 +15,8 @@ GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
 along with GCC; see the file COPYING.  If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA.  */
+the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA.  */
 
 #include "config.h"
 #include "system.h"
@@ -152,6 +152,7 @@ static void note_addressable (tree, stmt_ann_t);
 static void get_expr_operands (tree, tree *, int);
 static void get_asm_expr_operands (tree);
 static void get_indirect_ref_operands (tree, tree, int);
+static void get_tmr_operands (tree, tree, int);
 static void get_call_expr_operands (tree, tree);
 static inline void append_def (tree *);
 static inline void append_use (tree *);
@@ -997,8 +998,7 @@ build_ssa_operands (tree stmt)
 
 
 /* Free any operands vectors in OPS.  */
-#if 0
-static void 
+void 
 free_ssa_operands (stmt_operands_p ops)
 {
   ops->def_ops = NULL;
@@ -1006,14 +1006,7 @@ free_ssa_operands (stmt_operands_p ops)
   ops->maydef_ops = NULL;
   ops->mustdef_ops = NULL;
   ops->vuse_ops = NULL;
-  while (ops->memory.next != NULL)
-    {
-      operand_memory_p tmp = ops->memory.next;
-      ops->memory.next = tmp->next;
-      ggc_free (tmp);
-    }
 }
-#endif
 
 
 /* Get the operands of statement STMT.  Note that repeated calls to
@@ -1289,6 +1282,10 @@ get_expr_operands (tree stmt, tree *expr_p, int flags)
       get_indirect_ref_operands (stmt, expr, flags);
       return;
 
+    case TARGET_MEM_REF:
+      get_tmr_operands (stmt, expr, flags);
+      return;
+
     case ARRAY_REF:
     case ARRAY_RANGE_REF:
       /* Treat array references as references to the virtual variable
@@ -1341,7 +1338,11 @@ get_expr_operands (tree stmt, tree *expr_p, int flags)
                             flags & ~opf_kill_def);
        
        if (code == COMPONENT_REF)
-         get_expr_operands (stmt, &TREE_OPERAND (expr, 2), opf_none);
+         {
+           if (s_ann && TREE_THIS_VOLATILE (TREE_OPERAND (expr, 1)))
+             s_ann->has_volatile_ops = true; 
+           get_expr_operands (stmt, &TREE_OPERAND (expr, 2), opf_none);
+         }
        return;
       }
     case WITH_SIZE_EXPR:
@@ -1554,10 +1555,10 @@ get_asm_expr_operands (tree stmt)
          add_stmt_operand (&global_var, s_ann, opf_is_def);
        else
          EXECUTE_IF_SET_IN_BITMAP (call_clobbered_vars, 0, i, bi)
-             {
-               tree var = referenced_var (i);
-               add_stmt_operand (&var, s_ann, opf_is_def | opf_non_specific);
-             }
+           {
+             tree var = referenced_var (i);
+             add_stmt_operand (&var, s_ann, opf_is_def | opf_non_specific);
+           }
 
        /* Now clobber all addressables.  */
        EXECUTE_IF_SET_IN_BITMAP (addressable_vars, 0, i, bi)
@@ -1672,6 +1673,30 @@ get_indirect_ref_operands (tree stmt, tree expr, int flags)
   get_expr_operands (stmt, pptr, opf_none);
 }
 
+/* A subroutine of get_expr_operands to handle TARGET_MEM_REF.  */
+
+static void
+get_tmr_operands (tree stmt, tree expr, int flags)
+{
+  tree tag = TMR_TAG (expr);
+
+  /* First record the real operands.  */
+  get_expr_operands (stmt, &TMR_BASE (expr), opf_none);
+  get_expr_operands (stmt, &TMR_INDEX (expr), opf_none);
+
+  /* MEM_REFs should never be killing.  */
+  flags &= ~opf_kill_def;
+
+  if (TMR_SYMBOL (expr))
+    note_addressable (TMR_SYMBOL (expr), stmt_ann (stmt));
+
+  if (tag)
+    add_stmt_operand (&tag, stmt_ann (stmt), flags);
+  else
+    /* Something weird, so ensure that we will be careful.  */
+    stmt_ann (stmt)->has_volatile_ops = true;
+}
+
 /* A subroutine of get_expr_operands to handle CALL_EXPR.  */
 
 static void
@@ -1912,10 +1937,10 @@ note_addressable (tree var, stmt_ann_t s_ann)
        {
          subvar_t sv;
          for (sv = svars; sv; sv = sv->next)
-           bitmap_set_bit (s_ann->addresses_taken, var_ann (sv->var)->uid);
+           bitmap_set_bit (s_ann->addresses_taken, DECL_UID (sv->var));
        }
       else
-       bitmap_set_bit (s_ann->addresses_taken, var_ann (var)->uid);
+       bitmap_set_bit (s_ann->addresses_taken, DECL_UID (var));
     }
 }