re PR target/65697 (__atomic memory barriers not strong enough for __sync builtins)
[gcc.git] / gcc / alias.c
index 408d058d2e7ef6531c118a8c503c4b644d1cf9fe..ca2082e7e65f6ff3b78423349c98fe5dc7545e17 100644 (file)
@@ -23,7 +23,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "coretypes.h"
 #include "tm.h"
 #include "rtl.h"
-#include "input.h"
 #include "alias.h"
 #include "symtab.h"
 #include "tree.h"
@@ -58,7 +57,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "tree-ssa-alias.h"
 #include "internal-fn.h"
 #include "gimple-expr.h"
-#include "is-a.h"
 #include "gimple.h"
 #include "gimple-ssa.h"
 #include "rtl-iter.h"
@@ -143,31 +141,7 @@ along with GCC; see the file COPYING3.  If not see
    However, this is no actual entry for alias set zero.  It is an
    error to attempt to explicitly construct a subset of zero.  */
 
-struct alias_set_traits : default_hashmap_traits
-{
-  template<typename T>
-  static bool
-  is_empty (T &e)
-  {
-    return e.m_key == INT_MIN;
-  }
-
-  template<typename  T>
-  static bool
-  is_deleted (T &e)
-  {
-    return e.m_key == (INT_MIN + 1);
-  }
-
-  template<typename T> static void mark_empty (T &e) { e.m_key = INT_MIN; }
-
-  template<typename T>
-  static void
-  mark_deleted (T &e)
-  {
-    e.m_key = INT_MIN + 1;
-  }
-};
+struct alias_set_hash : int_hash <int, INT_MIN, INT_MIN + 1> {};
 
 struct GTY(()) alias_set_entry_d {
   /* The alias set number, as stored in MEM_ALIAS_SET.  */
@@ -180,7 +154,7 @@ struct GTY(()) alias_set_entry_d {
 
      continuing our example above, the children here will be all of
      `int', `double', `float', and `struct S'.  */
-  hash_map<int, int, alias_set_traits> *children;
+  hash_map<alias_set_hash, int> *children;
 
   /* Nonzero if would have a child of zero: this effectively makes this
      alias set the same as alias set zero.  */
@@ -1159,7 +1133,7 @@ record_alias_subset (alias_set_type superset, alias_set_type subset)
       subset_entry = get_alias_set_entry (subset);
       if (!superset_entry->children)
        superset_entry->children
-         = hash_map<int, int, alias_set_traits>::create_ggc (64);
+         = hash_map<alias_set_hash, int>::create_ggc (64);
       /* If there is an entry for the subset, enter all of its children
         (if they are not already present) as children of the SUPERSET.  */
       if (subset_entry)
@@ -1171,7 +1145,7 @@ record_alias_subset (alias_set_type superset, alias_set_type subset)
 
          if (subset_entry->children)
            {
-             hash_map<int, int, alias_set_traits>::iterator iter
+             hash_map<alias_set_hash, int>::iterator iter
                = subset_entry->children->begin ();
              for (; iter != subset_entry->children->end (); ++iter)
                superset_entry->children->put ((*iter).first, (*iter).second);
@@ -2542,19 +2516,6 @@ nonoverlapping_memrefs_p (const_rtx x, const_rtx y, bool loop_invariant)
   if (! DECL_P (exprx) || ! DECL_P (expry))
     return 0;
 
-  /* If we refer to different gimple registers, or one gimple register
-     and one non-gimple-register, we know they can't overlap.  First,
-     gimple registers don't have their addresses taken.  Now, there
-     could be more than one stack slot for (different versions of) the
-     same gimple register, but we can presumably tell they don't
-     overlap based on offsets from stack base addresses elsewhere.
-     It's important that we don't proceed to DECL_RTL, because gimple
-     registers may not pass DECL_RTL_SET_P, and make_decl_rtl won't be
-     able to do anything about them since no SSA information will have
-     remained to guide it.  */
-  if (is_gimple_reg (exprx) || is_gimple_reg (expry))
-    return exprx != expry;
-
   /* With invalid code we can end up storing into the constant pool.
      Bail out to avoid ICEing when creating RTL for this.
      See gfortran.dg/lto/20091028-2_0.f90.  */