OSDN Git Service

2006-03-31 Asher Langton <langton2@llnl.gov>
[pf3gnuchains/gcc-fork.git] / gcc / tree-ssa-alias.c
index eacfed7..f0d16d4 100644 (file)
@@ -603,7 +603,7 @@ recalculate_used_alone (void)
    max-aliased-vops}), alias sets are grouped to avoid severe
    compile-time slow downs and memory consumption.  See group_aliases.  */
 
-static void
+static unsigned int
 compute_may_aliases (void)
 {
   struct alias_info *ai;
@@ -676,6 +676,7 @@ compute_may_aliases (void)
   }
   recalculate_used_alone ();
   updating_used_alone = false;
+  return 0;
 }
 
 
@@ -1803,8 +1804,17 @@ may_alias_p (tree ptr, HOST_WIDE_INT mem_alias_set,
       alias_stats.simple_resolved++;
       return false;
     }
-  
-  /* If -fargument-noalias-global is >1, pointer arguments may
+
+  /* If -fargument-noalias-global is > 2, pointer arguments may
+     not point to anything else.  */
+  if (flag_argument_noalias > 2 && TREE_CODE (ptr) == PARM_DECL)
+    {
+      alias_stats.alias_noalias++;
+      alias_stats.simple_resolved++;
+      return false;
+    }
+
+  /* If -fargument-noalias-global is > 1, pointer arguments may
      not point to global variables.  */
   if (flag_argument_noalias > 1 && is_global_var (var)
       && TREE_CODE (ptr) == PARM_DECL)
@@ -2843,6 +2853,7 @@ create_sft (tree var, tree field, unsigned HOST_WIDE_INT offset,
   TREE_PUBLIC  (subvar) = TREE_PUBLIC (var);
   TREE_STATIC (subvar) = TREE_STATIC (var);
   TREE_READONLY (subvar) = TREE_READONLY (var);
+  TREE_ADDRESSABLE (subvar) = TREE_ADDRESSABLE (var);
 
   /* Add the new variable to REFERENCED_VARS.  */
   ann = get_var_ann (subvar);
@@ -3125,7 +3136,7 @@ find_used_portions (tree *tp, int *walk_subtrees, void *lhs_p)
 
 /* Create structure field variables for structures used in this function.  */
 
-static void
+static unsigned int
 create_structure_vars (void)
 {
   basic_block bb;
@@ -3158,7 +3169,7 @@ create_structure_vars (void)
     }
   htab_delete (used_portions);
   VEC_free (tree, heap, varvec);
-
+  return 0;
 }
 
 static bool
@@ -3183,3 +3194,34 @@ struct tree_opt_pass pass_create_structure_vars =
   TODO_dump_func,       /* todo_flags_finish */
   0                     /* letter */
 };
+
+/* Reset the DECL_CALL_CLOBBERED flags on our referenced vars.  In
+   theory, this only needs to be done for globals.  */
+
+static unsigned int
+reset_cc_flags (void)
+{
+  tree var;
+  referenced_var_iterator rvi;
+
+  FOR_EACH_REFERENCED_VAR (var, rvi)
+    DECL_CALL_CLOBBERED (var) = false;
+  return 0;
+}
+
+struct tree_opt_pass pass_reset_cc_flags =
+{
+  NULL,                 /* name */
+  NULL,         /* gate */
+  reset_cc_flags, /* execute */
+  NULL,                         /* sub */
+  NULL,                         /* next */
+  0,                    /* static_pass_number */
+  0,                    /* tv_id */
+  PROP_referenced_vars |PROP_cfg, /* properties_required */
+  0,                    /* properties_provided */
+  0,                    /* properties_destroyed */
+  0,                    /* todo_flags_start */
+  0,                    /* todo_flags_finish */
+  0                     /* letter */
+};