tree-optimize.c (init_tree_optimization_passes): Schedule pass_may_alias right after...
authorDiego Novillo <dnovillo@redhat.com>
Wed, 28 Jul 2004 05:13:10 +0000 (05:13 +0000)
committerDiego Novillo <dnovillo@gcc.gnu.org>
Wed, 28 Jul 2004 05:13:10 +0000 (01:13 -0400)
* tree-optimize.c (init_tree_optimization_passes): Schedule
pass_may_alias right after the program is renamed into SSA.
* tree-pass.h (PROP_alias): Define.
* tree-outof-ssa.c (pass_del_ssa): Require PROP_alias.
* tree-sra.c (pass_sra): Likewise.
* tree-ssa-ccp.c (pass_ccp): Likewise.
* tree-ssa-copyrename.c (pass_rename_ssa_ccp): Likewise.
* tree-ssa-dce.c (pass_dce): Likewise.
* tree-ssa-dom.c (pass_dominator): Likewise.
* tree-ssa-dse.c (pass_dse): Likewise.
* tree-ssa-forwprop.c (pass_forwprop): Likewise.
* tree-ssa-loop-ch.c (pass_ch): Likewise.
* tree-ssa-phiopt.c (pass_phiopt): Likewise.
* tree-ssa-pre.c (pass_pre): Likewise.
* tree-tailcall.c (pass_tail_recursion): Likewise.
* tree-ssa.c (pass_redundant_phi): Likewise.
* tree-ssa-alias.c (aliases_computed_p): Remove.
Update all users.
(init_alias_info): Do not mark all type tags for renaming
unconditionally.
Clear may_aliases from every symbol.
(setup_pointers_and_addressables): If a pointer has not been
dereferenced and it had a type tag, clear it and mark the old
tag for renaming.

testsuite/ChangeLog

* gcc.dg/tree-ssa/20030714-2.c: Adjust number of expected
conditionals.
* gcc.dg/tree-ssa/20031022-1.c: Adjust number of expected
loads.
* gcc.dg/tree-ssa/ssa-dom-cse-1.c: Expect optimization in
DOM1.

From-SVN: r85255

22 files changed:
gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/tree-ssa/20030714-2.c
gcc/testsuite/gcc.dg/tree-ssa/20031022-1.c
gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-cse-1.c
gcc/tree-optimize.c
gcc/tree-outof-ssa.c
gcc/tree-pass.h
gcc/tree-sra.c
gcc/tree-ssa-alias.c
gcc/tree-ssa-ccp.c
gcc/tree-ssa-copyrename.c
gcc/tree-ssa-dce.c
gcc/tree-ssa-dom.c
gcc/tree-ssa-dse.c
gcc/tree-ssa-forwprop.c
gcc/tree-ssa-loop-ch.c
gcc/tree-ssa-operands.c
gcc/tree-ssa-phiopt.c
gcc/tree-ssa-pre.c
gcc/tree-ssa.c
gcc/tree-tailcall.c

index 52bbdd9a9f3fc659d490288e89d12d9ea16f2eac..a3f30ff9d3d4b049d61d0f550da7e788a276a9c3 100644 (file)
@@ -1,3 +1,30 @@
+2004-07-28  Diego Novillo  <dnovillo@redhat.com>
+
+       * tree-optimize.c (init_tree_optimization_passes): Schedule
+       pass_may_alias right after the program is renamed into SSA.
+       * tree-pass.h (PROP_alias): Define.
+       * tree-outof-ssa.c (pass_del_ssa): Require PROP_alias.
+       * tree-sra.c (pass_sra): Likewise.
+       * tree-ssa-ccp.c (pass_ccp): Likewise.
+       * tree-ssa-copyrename.c (pass_rename_ssa_ccp): Likewise.
+       * tree-ssa-dce.c (pass_dce): Likewise.
+       * tree-ssa-dom.c (pass_dominator): Likewise.
+       * tree-ssa-dse.c (pass_dse): Likewise.
+       * tree-ssa-forwprop.c (pass_forwprop): Likewise.
+       * tree-ssa-loop-ch.c (pass_ch): Likewise.
+       * tree-ssa-phiopt.c (pass_phiopt): Likewise.
+       * tree-ssa-pre.c (pass_pre): Likewise.
+       * tree-tailcall.c (pass_tail_recursion): Likewise.
+       * tree-ssa.c (pass_redundant_phi): Likewise.
+       * tree-ssa-alias.c (aliases_computed_p): Remove.
+       Update all users.
+       (init_alias_info): Do not mark all type tags for renaming
+       unconditionally.
+       Clear may_aliases from every symbol.
+       (setup_pointers_and_addressables): If a pointer has not been
+       dereferenced and it had a type tag, clear it and mark the old
+       tag for renaming.
+
 2004-07-28  Diego Novillo  <dnovillo@redhat.com>
 
        PR tree-optimization/16705
index 35a5a3aa3761ad0c49a4376f7033f4e4b7df93f9..8b99613999f67a96302a002770694f62c300f3ab 100644 (file)
@@ -1,3 +1,12 @@
+2004-07-28  Diego Novillo  <dnovillo@redhat.com>
+
+       * gcc.dg/tree-ssa/20030714-2.c: Adjust number of expected
+       conditionals.
+       * gcc.dg/tree-ssa/20031022-1.c: Adjust number of expected
+       loads.
+       * gcc.dg/tree-ssa/ssa-dom-cse-1.c: Expect optimization in
+       DOM1.
+
 2004-07-27  Andrew Pinski  <apinski@apple.com>
 
        * g++.dg/rtti/tinfo1.C: Correct the xfail.
index 6a43360b07fff527838f2491087cae8a1e6cdebd..2c8a84a494d0486c5396cce4ab99fe7360e8ccb2 100644 (file)
@@ -32,8 +32,8 @@ get_alias_set (t)
     }
 }
 
-/* There should be exactly four IF conditionals if we thread jumps
+/* There should be exactly three IF conditionals if we thread jumps
    properly.  */
-/* { dg-final { scan-tree-dump-times "if " 4 "dom3"} } */
+/* { dg-final { scan-tree-dump-times "if " 3 "dom3"} } */
  
 
index 546e6b00759f1cdab9944a74eb0e793f8c7fa052..d4f9b3c361172d20508601969312ffd30b9a7fb2 100644 (file)
@@ -23,5 +23,5 @@ blah (int arf)
   foo (e);
 }
 
-/* There should be two loads from entry_exit_blocks[1].pred.  */
+/* There should be one load from entry_exit_blocks[1].pred.  */
 /* { dg-final { scan-tree-dump-times "entry_exit_blocks.1..pred" 2 "dom1"} } */
index 4e4ed8c912f5d0e8a379f4bdb725e707a04e0534..52531009e67f93423308c6134924f1de4b9cdc79 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do compile } */ 
-/* { dg-options "-O2 -fdump-tree-dom2-details" } */
+/* { dg-options "-O2 -fdump-tree-dom1-details" } */
 int t(int a) __attribute__ ((const));
 void q (void);
 void
@@ -11,6 +11,5 @@ threading(int a,int b)
            q();
        }
 }
-/* We should thread the jump twice and eliminate it.  Test this in
-   DOM2, after aliases have been computed.  */
-/* { dg-final { scan-tree-dump-times "Replaced.* t " 1 "dom2"} } */
+/* We should thread the jump twice and eliminate it.  */
+/* { dg-final { scan-tree-dump-times "Replaced.* t " 1 "dom1"} } */
index d575990cce67d58c7cbef715e6da9ac6bd06ef12..d41bebc618a1bc762a2bb8f378ddf83b7af18e69 100644 (file)
@@ -321,6 +321,7 @@ init_tree_optimization_passes (void)
   NEXT_PASS (pass_referenced_vars);
   NEXT_PASS (pass_build_pta);
   NEXT_PASS (pass_build_ssa);
+  NEXT_PASS (pass_may_alias);
   NEXT_PASS (pass_rename_ssa_copies);
   NEXT_PASS (pass_early_warn_uninitialized);
   NEXT_PASS (pass_dce);
index d1899981c1f0881e9e351f3de5616608dc42c39f..1fef266646df0dec82b18880e6f3f2d712465a3f 100644 (file)
@@ -2213,7 +2213,7 @@ struct tree_opt_pass pass_del_ssa =
   NULL,                                        /* next */
   0,                                   /* static_pass_number */
   TV_TREE_SSA_TO_NORMAL,               /* tv_id */
-  PROP_cfg | PROP_ssa,                 /* properties_required */
+  PROP_cfg | PROP_ssa | PROP_alias,    /* properties_required */
   0,                                   /* properties_provided */
   /* ??? If TER is enabled, we also kill gimple.  */
   PROP_ssa,                            /* properties_destroyed */
index 9651c9e659b51727b02747384ca0629a95eab5fb..2bf63ee77b66c08c10d1230259cf404edd8f6de7 100644 (file)
@@ -76,6 +76,7 @@ struct tree_opt_pass
 #define PROP_ssa               (1 << 6)
 #define PROP_no_crit_edges      (1 << 7)
 #define PROP_rtl               (1 << 8)
+#define PROP_alias             (1 << 9)
 
 #define PROP_trees \
   (PROP_gimple_any | PROP_gimple_lcf | PROP_gimple_leh)
index 30d8e34d32b08f6e084b02b69d5106044311648b..b3fa20c6c7767ef28a16c7656070399e3f47da10 100644 (file)
@@ -2118,7 +2118,7 @@ struct tree_opt_pass pass_sra =
   NULL,                                        /* next */
   0,                                   /* static_pass_number */
   TV_TREE_SRA,                         /* tv_id */
-  PROP_cfg | PROP_ssa,                 /* properties_required */
+  PROP_cfg | PROP_ssa | PROP_alias,    /* properties_required */
   0,                                   /* properties_provided */
   0,                                   /* properties_destroyed */
   0,                                   /* todo_flags_start */
index 64476ebe3015fa725796c6701c920bfafbec6405..94ccd800929aecdda8c822f98d6ed732ddc754cd 100644 (file)
@@ -175,13 +175,6 @@ bitmap call_clobbered_vars;
    variable).  */
 bitmap addressable_vars;
 
-/* 'true' after aliases have been computed (see compute_may_aliases).  This
-   is used by get_stmt_operands and its helpers to determine what to do
-   when scanning an operand for a variable that may be aliased.  If
-   may-alias information is still not available, the statement is marked as
-   having volatile operands.  */
-bool aliases_computed_p;
-
 /* When the program has too many call-clobbered variables and call-sites,
    this variable is used to represent the clobbering effects of function
    calls.  In these cases, all the call clobbered variables in the program
@@ -350,9 +343,6 @@ compute_may_aliases (void)
 
   /* Deallocate memory used by aliasing data structures.  */
   delete_alias_info (ai);
-
-  /* Indicate that may-alias information is now available.  */
-  aliases_computed_p = true;
 }
 
 struct tree_opt_pass pass_may_alias = 
@@ -365,7 +355,7 @@ struct tree_opt_pass pass_may_alias =
   0,                                   /* static_pass_number */
   TV_TREE_MAY_ALIAS,                   /* tv_id */
   PROP_cfg | PROP_ssa | PROP_pta,      /* properties_required */
-  0,                                   /* properties_provided */
+  PROP_alias,                          /* properties_provided */
   0,                                   /* properties_destroyed */
   0,                                   /* todo_flags_start */
   TODO_dump_func | TODO_rename_vars
@@ -379,6 +369,7 @@ static struct alias_info *
 init_alias_info (void)
 {
   struct alias_info *ai;
+  static bool aliases_computed_p = false;
 
   ai = xcalloc (1, sizeof (struct alias_info));
   ai->ssa_names_visited = BITMAP_XMALLOC ();
@@ -417,14 +408,8 @@ init_alias_info (void)
       for (i = 0; i < num_referenced_vars; i++)
        {
          var_ann_t ann = var_ann (referenced_var (i));
-
          ann->is_alias_tag = 0;
-         if (ann->type_mem_tag)
-           {
-             var_ann_t tag_ann = var_ann (ann->type_mem_tag);
-             tag_ann->may_aliases = NULL;
-             bitmap_set_bit (vars_to_rename, tag_ann->uid);
-           }
+         ann->may_aliases = NULL;
        }
 
       /* Clear flow-sensitive points-to information from each SSA name.  */
@@ -450,12 +435,13 @@ init_alias_info (void)
              pi->is_dereferenced = 0;
              if (pi->pt_vars)
                bitmap_clear (pi->pt_vars);
-             if (pi->name_mem_tag)
-               var_ann (pi->name_mem_tag)->may_aliases = NULL;
            }
        }
     }
 
+  /* Next time, we will need to reset alias information.  */
+  aliases_computed_p = true;
+
   return ai;
 }
 
@@ -1375,47 +1361,64 @@ setup_pointers_and_addressables (struct alias_info *ai)
 
       /* Add pointer variables that have been dereferenced to the POINTERS
          array and create a type memory tag for them.  */
-      if (POINTER_TYPE_P (TREE_TYPE (var))
-         && (bitmap_bit_p (ai->dereferenced_ptrs_store, v_ann->uid)
-             || bitmap_bit_p (ai->dereferenced_ptrs_load, v_ann->uid)))
+      if (POINTER_TYPE_P (TREE_TYPE (var)))
        {
-         tree tag;
-         var_ann_t t_ann;
-
-         /* If pointer VAR still doesn't have a memory tag associated
-            with it, create it now or re-use an existing one.  */
-         tag = get_tmt_for (var, ai);
-         t_ann = var_ann (tag);
-
-         /* The type tag will need to be renamed into SSA afterwards.
-            Note that we cannot do this inside get_tmt_for because
-            aliasing may run multiple times and we only create type
-            tags the first time.  */
-         bitmap_set_bit (vars_to_rename, t_ann->uid);
-
-         /* Associate the tag with pointer VAR.  */
-         v_ann->type_mem_tag = tag;
-
-         /* If pointer VAR has been used in a store operation, then its
-            memory tag must be marked as written-to.  */
-         if (bitmap_bit_p (ai->dereferenced_ptrs_store, v_ann->uid))
-           bitmap_set_bit (ai->written_vars, t_ann->uid);
-
-         /* If pointer VAR is a global variable or a PARM_DECL, then its
-            memory tag should be considered a global variable.  */
-         if (TREE_CODE (var) == PARM_DECL || needs_to_live_in_memory (var))
-           mark_call_clobbered (tag);
-
-         /* All the dereferences of pointer VAR count as references of
-            TAG.  Since TAG can be associated with several pointers, add
-            the dereferences of VAR to the TAG.  We may need to grow
-            AI->NUM_REFERENCES because we have been adding name and
-            type tags.  */
-         if (t_ann->uid >= VARRAY_SIZE (ai->num_references))
-           VARRAY_GROW (ai->num_references, t_ann->uid + 10);
-
-         VARRAY_UINT (ai->num_references, t_ann->uid)
-             += VARRAY_UINT (ai->num_references, v_ann->uid);
+         if ((bitmap_bit_p (ai->dereferenced_ptrs_store, v_ann->uid)
+               || bitmap_bit_p (ai->dereferenced_ptrs_load, v_ann->uid)))
+           {
+             tree tag;
+             var_ann_t t_ann;
+
+             /* If pointer VAR still doesn't have a memory tag
+                associated with it, create it now or re-use an
+                existing one.  */
+             tag = get_tmt_for (var, ai);
+             t_ann = var_ann (tag);
+
+             /* The type tag will need to be renamed into SSA
+                afterwards. Note that we cannot do this inside
+                get_tmt_for because aliasing may run multiple times
+                and we only create type tags the first time.  */
+             bitmap_set_bit (vars_to_rename, t_ann->uid);
+
+             /* Associate the tag with pointer VAR.  */
+             v_ann->type_mem_tag = tag;
+
+             /* If pointer VAR has been used in a store operation,
+                then its memory tag must be marked as written-to.  */
+             if (bitmap_bit_p (ai->dereferenced_ptrs_store, v_ann->uid))
+               bitmap_set_bit (ai->written_vars, t_ann->uid);
+
+             /* If pointer VAR is a global variable or a PARM_DECL,
+                then its memory tag should be considered a global
+                variable.  */
+             if (TREE_CODE (var) == PARM_DECL || needs_to_live_in_memory (var))
+               mark_call_clobbered (tag);
+
+             /* All the dereferences of pointer VAR count as
+                references of TAG.  Since TAG can be associated with
+                several pointers, add the dereferences of VAR to the
+                TAG.  We may need to grow AI->NUM_REFERENCES because
+                we have been adding name and type tags.  */
+             if (t_ann->uid >= VARRAY_SIZE (ai->num_references))
+               VARRAY_GROW (ai->num_references, t_ann->uid + 10);
+
+             VARRAY_UINT (ai->num_references, t_ann->uid)
+               += VARRAY_UINT (ai->num_references, v_ann->uid);
+           }
+         else
+           {
+             /* The pointer has not been dereferenced.  If it had a
+                type memory tag, remove it and mark the old tag for
+                renaming to remove it out of the IL.  */
+             var_ann_t ann = var_ann (var);
+             tree tag = ann->type_mem_tag;
+             if (tag)
+               {
+                 bitmap_set_bit (vars_to_rename, var_ann (tag)->uid);
+                 ann->type_mem_tag = NULL_TREE;
+               }
+           }
        }
     }
 
index 04ab19d8ff66482c9c5b83b6f67c246c1ae4913f..82479f052e69981bc47f3884c721bbdaff3db52e 100644 (file)
@@ -245,7 +245,7 @@ struct tree_opt_pass pass_ccp =
   NULL,                                        /* next */
   0,                                   /* static_pass_number */
   TV_TREE_CCP,                         /* tv_id */
-  PROP_cfg | PROP_ssa,                 /* properties_required */
+  PROP_cfg | PROP_ssa | PROP_alias,    /* properties_required */
   0,                                   /* properties_provided */
   0,                                   /* properties_destroyed */
   0,                                   /* todo_flags_start */
@@ -2704,7 +2704,7 @@ struct tree_opt_pass pass_fold_builtins =
   NULL,                                        /* next */
   0,                                   /* static_pass_number */
   0,                                   /* tv_id */
-  PROP_cfg | PROP_ssa,                 /* properties_required */
+  PROP_cfg | PROP_ssa | PROP_alias,    /* properties_required */
   0,                                   /* properties_provided */
   0,                                   /* properties_destroyed */
   0,                                   /* todo_flags_start */
index ac7c00aa06eed618dc05106de541a7e54331c672..2fd87e2214b42ec46d7bea869578bb8b15ae0236 100644 (file)
@@ -391,7 +391,7 @@ struct tree_opt_pass pass_rename_ssa_copies =
   NULL,                                        /* next */
   0,                                   /* static_pass_number */
   TV_TREE_COPY_RENAME,                 /* tv_id */
-  PROP_cfg | PROP_ssa,                 /* properties_required */
+  PROP_cfg | PROP_ssa | PROP_alias,    /* properties_required */
   0,                                   /* properties_provided */
   0,                                   /* properties_destroyed */
   0,                                   /* todo_flags_start */ 
index 1d3038fc60cb2977759c57f3de5933564f70ba30..c94a2f6c6d67607fa5ae5eed4131cf189abd826d 100644 (file)
@@ -908,7 +908,7 @@ struct tree_opt_pass pass_dce =
   NULL,                                        /* next */
   0,                                   /* static_pass_number */
   TV_TREE_DCE,                         /* tv_id */
-  PROP_cfg | PROP_ssa,                 /* properties_required */
+  PROP_cfg | PROP_ssa | PROP_alias,    /* properties_required */
   0,                                   /* properties_provided */
   0,                                   /* properties_destroyed */
   0,                                   /* todo_flags_start */
@@ -924,7 +924,7 @@ struct tree_opt_pass pass_cd_dce =
   NULL,                                        /* next */
   0,                                   /* static_pass_number */
   TV_TREE_CD_DCE,                      /* tv_id */
-  PROP_cfg | PROP_ssa,                 /* properties_required */
+  PROP_cfg | PROP_ssa | PROP_alias,    /* properties_required */
   0,                                   /* properties_provided */
   0,                                   /* properties_destroyed */
   0,                                   /* todo_flags_start */
index 7382d5f8875ef17f264c8f31183cd87d9dd70be2..036706f9f37a78f149f561270c267b07d907d4e7 100644 (file)
@@ -692,7 +692,7 @@ struct tree_opt_pass pass_dominator =
   NULL,                                        /* next */
   0,                                   /* static_pass_number */
   TV_TREE_SSA_DOMINATOR_OPTS,          /* tv_id */
-  PROP_cfg | PROP_ssa,                 /* properties_required */
+  PROP_cfg | PROP_ssa | PROP_alias,    /* properties_required */
   0,                                   /* properties_provided */
   0,                                   /* properties_destroyed */
   0,                                   /* todo_flags_start */
index efc7d7fbef4040aa92801106a3c1ff5b1d2c91c4..26aae0cb143cbf2382708f82930179a5c848e8fe 100644 (file)
@@ -437,7 +437,8 @@ struct tree_opt_pass pass_dse = {
   NULL,                                /* next */
   0,                           /* static_pass_number */
   TV_TREE_DSE,                 /* tv_id */
-  PROP_cfg | PROP_ssa,         /* properties_required */
+  PROP_cfg | PROP_ssa
+    | PROP_alias,              /* properties_required */
   0,                           /* properties_provided */
   0,                           /* properties_destroyed */
   0,                           /* todo_flags_start */
index 7df513f4e8aff694a9fe297dddf5981492f7591b..2cb3b9bd20b58791c91a77d14bf55bd6f12b0caa 100644 (file)
@@ -517,7 +517,8 @@ struct tree_opt_pass pass_forwprop = {
   NULL,                                /* next */
   0,                           /* static_pass_number */
   TV_TREE_FORWPROP,            /* tv_id */
-  PROP_cfg | PROP_ssa,         /* properties_required */
+  PROP_cfg | PROP_ssa
+    | PROP_alias,              /* properties_required */
   0,                           /* properties_provided */
   0,                           /* properties_destroyed */
   0,                           /* todo_flags_start */
index 5794a86cd6c67ad27d2dea6ab8d816d7d52d9827..ddb2438bae7d649b19e448063fe729a232952f2e 100644 (file)
@@ -340,7 +340,7 @@ struct tree_opt_pass pass_ch =
   NULL,                                        /* next */
   0,                                   /* static_pass_number */
   TV_TREE_CH,                          /* tv_id */
-  PROP_cfg | PROP_ssa,                 /* properties_required */
+  PROP_cfg | PROP_ssa | PROP_alias,    /* properties_required */
   0,                                   /* properties_provided */
   0,                                   /* properties_destroyed */
   0,                                   /* todo_flags_start */
index bd80da333418517608f0de144fd340d2d50baa70..a9e864ed8c1c018f17483288134a6f649199e700 100644 (file)
@@ -1137,13 +1137,6 @@ get_asm_expr_operands (tree stmt, voperands_t prev_vops)
              add_stmt_operand (&var, stmt, opf_is_def, prev_vops);
            });
 
-       /* If we don't have call-clobbered nor addressable vars and we
-          still have not computed aliasing information, just mark the
-          statement as having volatile operands.  If the alias pass
-          finds some, we will add them at that point.  */
-       if (!aliases_computed_p)
-         stmt_ann (stmt)->has_volatile_ops = true;
-
        break;
       }
 }
@@ -1159,53 +1152,42 @@ get_indirect_ref_operands (tree stmt, tree expr, int flags,
 
   if (SSA_VAR_P (ptr))
     {
-      if (!aliases_computed_p)
+      struct ptr_info_def *pi = NULL;
+
+      /* If PTR has flow-sensitive points-to information, use it.  */
+      if (TREE_CODE (ptr) == SSA_NAME
+         && (pi = SSA_NAME_PTR_INFO (ptr)) != NULL
+         && pi->name_mem_tag)
        {
-         /* If the pointer does not have a memory tag and aliases have not
-            been computed yet, mark the statement as having volatile
-            operands to prevent DOM from entering it in equivalence tables
-            and DCE from killing it.  */
-         stmt_ann (stmt)->has_volatile_ops = true;
+         /* PTR has its own memory tag.  Use it.  */
+         add_stmt_operand (&pi->name_mem_tag, stmt, flags, prev_vops);
        }
       else
        {
-         struct ptr_info_def *pi = NULL;
-
-         /* If we have computed aliasing already, check if PTR has
-            flow-sensitive points-to information.  */
-         if (TREE_CODE (ptr) == SSA_NAME
-             && (pi = SSA_NAME_PTR_INFO (ptr)) != NULL
-             && pi->name_mem_tag)
+         /* If PTR is not an SSA_NAME or it doesn't have a name
+            tag, use its type memory tag.  */
+         var_ann_t ann;
+
+         /* If we are emitting debugging dumps, display a warning if
+            PTR is an SSA_NAME with no flow-sensitive alias
+            information.  That means that we may need to compute
+            aliasing again.  */
+         if (dump_file
+             && TREE_CODE (ptr) == SSA_NAME
+             && pi == NULL)
            {
-             /* PTR has its own memory tag.  Use it.  */
-             add_stmt_operand (&pi->name_mem_tag, stmt, flags, prev_vops);
+             fprintf (dump_file,
+                 "NOTE: no flow-sensitive alias info for ");
+             print_generic_expr (dump_file, ptr, dump_flags);
+             fprintf (dump_file, " in ");
+             print_generic_stmt (dump_file, stmt, dump_flags);
            }
-         else
-           {
-             /* If PTR is not an SSA_NAME or it doesn't have a name
-                tag, use its type memory tag.  */
-             var_ann_t ann;
-
-             /* If we are emitting debugging dumps, display a warning if
-                PTR is an SSA_NAME with no flow-sensitive alias
-                information.  That means that we may need to compute
-                aliasing again.  */
-             if (dump_file
-                 && TREE_CODE (ptr) == SSA_NAME
-                 && pi == NULL)
-               {
-                 fprintf (dump_file,
-                          "NOTE: no flow-sensitive alias info for ");
-                 print_generic_expr (dump_file, ptr, dump_flags);
-                 fprintf (dump_file, " in ");
-                 print_generic_stmt (dump_file, stmt, dump_flags);
-               }
 
-             if (TREE_CODE (ptr) == SSA_NAME)
-               ptr = SSA_NAME_VAR (ptr);
-             ann = var_ann (ptr);
-             add_stmt_operand (&ann->type_mem_tag, stmt, flags, prev_vops);
-           }
+         if (TREE_CODE (ptr) == SSA_NAME)
+           ptr = SSA_NAME_VAR (ptr);
+         ann = var_ann (ptr);
+         if (ann->type_mem_tag)
+           add_stmt_operand (&ann->type_mem_tag, stmt, flags, prev_vops);
        }
     }
 
@@ -1272,8 +1254,6 @@ get_call_expr_operands (tree stmt, tree expr, voperands_t prev_vops)
       else if (!(call_flags & (ECF_CONST | ECF_NORETURN)))
        add_call_read_ops (stmt, prev_vops);
     }
-  else if (!aliases_computed_p)
-    stmt_ann (stmt)->has_volatile_ops = true;
 }
 
 
@@ -1348,13 +1328,6 @@ add_stmt_operand (tree *var_p, tree stmt, int flags, voperands_t prev_vops)
 
       aliases = v_ann->may_aliases;
 
-      /* If alias information hasn't been computed yet, then
-        addressable variables will not be an alias tag nor will they
-        have aliases.  In this case, mark the statement as having
-        volatile operands.  */
-      if (!aliases_computed_p && may_be_aliased (var))
-       s_ann->has_volatile_ops = true;
-
       if (aliases == NULL)
        {
          /* The variable is not aliased or it is an alias tag.  */
index 50c845e76379bb61800f271b03c653a3600bbb6c..ee48b25b2145ac263f373f91014f3f8fd71d508a 100644 (file)
@@ -669,7 +669,7 @@ struct tree_opt_pass pass_phiopt =
   NULL,                                        /* next */
   0,                                   /* static_pass_number */
   TV_TREE_PHIOPT,                      /* tv_id */
-  PROP_cfg | PROP_ssa,                 /* properties_required */
+  PROP_cfg | PROP_ssa | PROP_alias,    /* properties_required */
   0,                                   /* properties_provided */
   0,                                   /* properties_destroyed */
   0,                                   /* todo_flags_start */
index d24ebc0b547de130f4bafccd9e16c1b2fa4cf4d9..95ee573aa1a47483a1f23070f9816ee54798d2df 100644 (file)
@@ -2076,7 +2076,8 @@ struct tree_opt_pass pass_pre =
   NULL,                                        /* next */
   0,                                   /* static_pass_number */
   TV_TREE_PRE,                         /* tv_id */
-  PROP_no_crit_edges | PROP_cfg | PROP_ssa,/* properties_required */
+  PROP_no_crit_edges | PROP_cfg
+    | PROP_ssa | PROP_alias,           /* properties_required */
   0,                                   /* properties_provided */
   0,                                   /* properties_destroyed */
   0,                                   /* todo_flags_start */
@@ -2107,7 +2108,7 @@ struct tree_opt_pass pass_fre =
   NULL,                                        /* next */
   0,                                   /* static_pass_number */
   TV_TREE_FRE,                         /* tv_id */
-  PROP_no_crit_edges | PROP_cfg | PROP_ssa,/* properties_required */
+  PROP_cfg | PROP_ssa | PROP_alias,    /* properties_required */
   0,                                   /* properties_provided */
   0,                                   /* properties_destroyed */
   0,                                   /* todo_flags_start */
index 27b3a5b1bf007827b8fce1becce90632e170bb29..52df86937e00ae27a75684eb5fdbe5f707a2c39b 100644 (file)
@@ -505,11 +505,8 @@ err:
 static void
 verify_alias_info (void)
 {
-  if (aliases_computed_p)
-    {
-      verify_flow_sensitive_alias_info ();
-      verify_flow_insensitive_alias_info ();
-    }
+  verify_flow_sensitive_alias_info ();
+  verify_flow_insensitive_alias_info ();
 }
 
 
@@ -677,7 +674,6 @@ init_tree_ssa (void)
   init_ssanames ();
   init_phinodes ();
   global_var = NULL_TREE;
-  aliases_computed_p = false;
 }
 
 
@@ -710,7 +706,6 @@ delete_tree_ssa (void)
   global_var = NULL_TREE;
   BITMAP_XFREE (call_clobbered_vars);
   call_clobbered_vars = NULL;
-  aliases_computed_p = false;
   BITMAP_XFREE (addressable_vars);
   addressable_vars = NULL;
 }
@@ -1211,7 +1206,7 @@ struct tree_opt_pass pass_redundant_phi =
   NULL,                                        /* next */
   0,                                   /* static_pass_number */
   0,                                   /* tv_id */
-  PROP_cfg | PROP_ssa,                 /* properties_required */
+  PROP_cfg | PROP_ssa | PROP_alias,    /* properties_required */
   0,                                   /* properties_provided */
   0,                                   /* properties_destroyed */
   0,                                   /* todo_flags_start */
index d3d48f5a89b8272b568a2f632b70f6404948ab6d..6599cbd09e2c30c2db875937807258608e481ff6 100644 (file)
@@ -937,7 +937,7 @@ struct tree_opt_pass pass_tail_recursion =
   NULL,                                        /* next */
   0,                                   /* static_pass_number */
   0,                                   /* tv_id */
-  PROP_cfg | PROP_ssa,                 /* properties_required */
+  PROP_cfg | PROP_ssa | PROP_alias,    /* properties_required */
   0,                                   /* properties_provided */
   0,                                   /* properties_destroyed */
   0,                                   /* todo_flags_start */
@@ -953,7 +953,7 @@ struct tree_opt_pass pass_tail_calls =
   NULL,                                        /* next */
   0,                                   /* static_pass_number */
   0,                                   /* tv_id */
-  PROP_cfg | PROP_ssa,                 /* properties_required */
+  PROP_cfg | PROP_ssa | PROP_alias,    /* properties_required */
   0,                                   /* properties_provided */
   0,                                   /* properties_destroyed */
   0,                                   /* todo_flags_start */